/system/keymaster/android_keymaster/ |
D | android_keymaster_messages.cpp | 41 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 …]
|
D | serializable.cpp | 47 bool copy_from_buf(const uint8_t** buf_ptr, const uint8_t* end, void* dest, size_t size) { in copy_from_buf() argument 48 if (buffer_bound_check(*buf_ptr, end, size)) { in copy_from_buf() 49 memcpy(dest, *buf_ptr, size); in copy_from_buf() 50 *buf_ptr += size; in copy_from_buf() 57 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 59 if (!copy_uint32_from_buf(buf_ptr, end, size)) in copy_size_and_data_from_buf() 67 if (buffer_bound_check(*buf_ptr, end, *size)) { in copy_size_and_data_from_buf() 72 return copy_from_buf(buf_ptr, end, dest->get(), *size); in copy_size_and_data_from_buf() 154 bool Buffer::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument 156 if (!copy_size_and_data_from_buf(buf_ptr, end, &buffer_size_, &buffer_)) { in Deserialize()
|
D | authorization_set.cpp | 366 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, ¶m->tag)) in deserialize() 376 return copy_uint32_from_buf(buf_ptr, end, ¶m->enumerated); in deserialize() 379 return copy_uint32_from_buf(buf_ptr, end, ¶m->integer); in deserialize() 382 return copy_uint64_from_buf(buf_ptr, end, ¶m->long_integer); in deserialize() 384 return copy_uint64_from_buf(buf_ptr, end, ¶m->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, ¶m->blob.data_length) || in deserialize() [all …]
|
/system/keymaster/key_blob_utils/ |
D | auth_encrypted_key_blob.cpp | 63 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/ |
D | android_keymaster_messages.h | 123 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override; 127 virtual bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) = 0; 150 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize() 151 return copy_uint32_from_buf(buf_ptr, end, &algorithm); in Deserialize() 176 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize() 177 return copy_uint32_from_buf(buf_ptr, end, &algorithm) && in Deserialize() 178 copy_uint32_from_buf(buf_ptr, end, &purpose); in Deserialize() 225 bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in NonErrorDeserialize() 229 if (!copy_uint32_array_from_buf(buf_ptr, end, &tmp, &results_length)) return false; in NonErrorDeserialize() 275 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize() [all …]
|
D | serializable.h | 53 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 …]
|
D | android_keymaster_utils.h | 388 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()
|
D | authorization_set.h | 445 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end); 459 bool DeserializeIndirectData(const uint8_t** buf_ptr, const uint8_t* end); 460 bool DeserializeElementsData(const uint8_t** buf_ptr, const uint8_t* end);
|
/system/chre/apps/wifi_offload/ |
D | utility.cc | 101 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/ |
D | android_keymaster_messages_test.cpp | 57 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()
|