Home
last modified time | relevance | path

Searched refs:buf_ptr (Results 1 – 11 of 11) sorted by relevance

/system/keymaster/android_keymaster/
Dandroid_keymaster_messages.cpp41 static bool deserialize_key_blob(keymaster_key_blob_t* key_blob, const uint8_t** buf_ptr, in deserialize_key_blob() argument
46 if (!copy_size_and_data_from_buf(buf_ptr, end, &key_blob->key_material_size, in deserialize_key_blob()
61 static bool deserialize_blob(keymaster_blob_t* blob, const uint8_t** buf_ptr, const uint8_t* end) { in deserialize_blob() argument
65 if (!copy_size_and_data_from_buf(buf_ptr, end, &blob->data_length, &deserialized_blob)) in deserialize_blob()
85 bool KeymasterResponse::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument
86 if (!copy_uint32_from_buf(buf_ptr, end, &error)) in Deserialize()
90 return NonErrorDeserialize(buf_ptr, end); in Deserialize()
107 bool GenerateKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument
108 return deserialize_key_blob(&key_blob, buf_ptr, end) && enforced.Deserialize(buf_ptr, end) && in NonErrorDeserialize()
109 unenforced.Deserialize(buf_ptr, end); in NonErrorDeserialize()
[all …]
Dserializable.cpp38 bool copy_from_buf(const uint8_t** buf_ptr, const uint8_t* end, void* dest, size_t size) { in copy_from_buf() argument
39 if (__pval(*buf_ptr) + size < __pval(*buf_ptr)) // Pointer wrap check in copy_from_buf()
42 if (end < *buf_ptr + size) in copy_from_buf()
44 memcpy(dest, *buf_ptr, size); in copy_from_buf()
45 *buf_ptr += size; in copy_from_buf()
49 bool copy_size_and_data_from_buf(const uint8_t** buf_ptr, const uint8_t* end, size_t* size, in copy_size_and_data_from_buf() argument
51 if (!copy_uint32_from_buf(buf_ptr, end, size)) in copy_size_and_data_from_buf()
54 if (__pval(*buf_ptr) + *size < __pval(*buf_ptr)) // Pointer wrap check in copy_size_and_data_from_buf()
57 if (*buf_ptr + *size > end) in copy_size_and_data_from_buf()
67 return copy_from_buf(buf_ptr, end, dest->get(), *size); in copy_size_and_data_from_buf()
[all …]
Dauthorization_set.cpp366 static bool deserialize(keymaster_key_param_t* param, const uint8_t** buf_ptr, const uint8_t* end, in deserialize() argument
368 if (!copy_uint32_from_buf(buf_ptr, end, &param->tag)) in deserialize()
376 return copy_uint32_from_buf(buf_ptr, end, &param->enumerated); in deserialize()
379 return copy_uint32_from_buf(buf_ptr, end, &param->integer); in deserialize()
382 return copy_uint64_from_buf(buf_ptr, end, &param->long_integer); in deserialize()
384 return copy_uint64_from_buf(buf_ptr, end, &param->date_time); in deserialize()
387 if (*buf_ptr < end) { in deserialize()
388 uint8_t temp = **buf_ptr; in deserialize()
393 (*buf_ptr)++; in deserialize()
402 if (!copy_uint32_from_buf(buf_ptr, end, &param->blob.data_length) || in deserialize()
[all …]
/system/keymaster/key_blob_utils/
Dauth_encrypted_key_blob.cpp63 const uint8_t** buf_ptr = &tmp; in DeserializeUnversionedBlob() local
69 if (!copy_from_buf(buf_ptr, end, nonce->peek_write(), OCB_NONCE_LENGTH) || in DeserializeUnversionedBlob()
70 !encrypted_key_material->Deserialize(buf_ptr, end) || in DeserializeUnversionedBlob()
71 !copy_from_buf(buf_ptr, end, tag->peek_write(), OCB_TAG_LENGTH) || in DeserializeUnversionedBlob()
72 !hw_enforced->Deserialize(buf_ptr, end) || // in DeserializeUnversionedBlob()
73 !sw_enforced->Deserialize(buf_ptr, end)) { in DeserializeUnversionedBlob()
91 const uint8_t** buf_ptr = &tmp; in DeserializeAuthEncryptedBlob() local
94 if (end <= *buf_ptr) in DeserializeAuthEncryptedBlob()
97 uint8_t version = *(*buf_ptr)++; in DeserializeAuthEncryptedBlob()
99 !nonce->Deserialize(buf_ptr, end) || nonce->available_read() != OCB_NONCE_LENGTH || in DeserializeAuthEncryptedBlob()
[all …]
/system/keymaster/include/keymaster/
Dserializable.h53 virtual bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) = 0;
143 bool copy_from_buf(const uint8_t** buf_ptr, const uint8_t* end, void* dest, size_t size);
152 bool copy_size_and_data_from_buf(const uint8_t** buf_ptr, const uint8_t* end, size_t* size,
160 inline bool copy_uint32_from_buf(const uint8_t** buf_ptr, const uint8_t* end, T* value) { in copy_uint32_from_buf() argument
162 if (!copy_from_buf(buf_ptr, end, &val, sizeof(val))) in copy_uint32_from_buf()
172 inline bool copy_uint64_from_buf(const uint8_t** buf_ptr, const uint8_t* end, uint64_t* value) { in copy_uint64_from_buf() argument
173 return copy_from_buf(buf_ptr, end, value, sizeof(*value)); in copy_uint64_from_buf()
183 inline bool copy_uint32_array_from_buf(const uint8_t** buf_ptr, const uint8_t* end, in copy_uint32_array_from_buf() argument
185 if (!copy_uint32_from_buf(buf_ptr, end, count)) in copy_uint32_array_from_buf()
188 uintptr_t array_end = __pval(*buf_ptr) + *count * sizeof(uint32_t); in copy_uint32_array_from_buf()
[all …]
Dandroid_keymaster_messages.h122 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override;
126 virtual bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) = 0;
149 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize()
150 return copy_uint32_from_buf(buf_ptr, end, &algorithm); in Deserialize()
175 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize()
176 return copy_uint32_from_buf(buf_ptr, end, &algorithm) && in Deserialize()
177 copy_uint32_from_buf(buf_ptr, end, &purpose); in Deserialize()
224 bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in NonErrorDeserialize()
228 if (!copy_uint32_array_from_buf(buf_ptr, end, &tmp, &results_length)) return false; in NonErrorDeserialize()
274 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize()
[all …]
Dandroid_keymaster_utils.h388 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize()
391 if (!copy_size_and_data_from_buf(buf_ptr, end, &accessBlobSize(this), &tmp)) { in Deserialize()
Dauthorization_set.h438 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end);
452 bool DeserializeIndirectData(const uint8_t** buf_ptr, const uint8_t* end);
453 bool DeserializeElementsData(const uint8_t** buf_ptr, const uint8_t* end);
/system/chre/apps/wifi_offload/
Dutility.cc101 char *buf_ptr = ssid_buffer; in LogSsid() local
103 buf_ptr += std::sprintf(buf_ptr, "%02" PRIx8 ":", ssid[i]); in LogSsid()
105 buf_ptr[-1] = '\0'; in LogSsid()
/system/keymaster/tests/
Dandroid_keymaster_messages_test.cpp57 bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize()
58 if (*buf_ptr >= end) in NonErrorDeserialize()
60 EXPECT_EQ(0, **buf_ptr); in NonErrorDeserialize()
61 (*buf_ptr)++; in NonErrorDeserialize()
/system/core/libion/tests/
Ddevice_test.cpp518 auto buf_ptr = std::make_unique<char[]>(4096); in TEST_F() local
519 void *buf = buf_ptr.get(); in TEST_F()