/system/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() 67 bool KeymasterResponse::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument 68 if (!copy_uint32_from_buf(buf_ptr, end, &error)) in Deserialize() 72 return NonErrorDeserialize(buf_ptr, end); in Deserialize() 89 bool GenerateKeyResponse::NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) { in NonErrorDeserialize() argument 90 return deserialize_key_blob(&key_blob, buf_ptr, end) && enforced.Deserialize(buf_ptr, end) && in NonErrorDeserialize() 91 unenforced.Deserialize(buf_ptr, end); in NonErrorDeserialize() 111 bool GetKeyCharacteristicsRequest::Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() argument 112 return deserialize_key_blob(&key_blob, buf_ptr, end) && in Deserialize() [all …]
|
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 …]
|
D | serializable.cpp | 38 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 (*buf_ptr + size < *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 (*buf_ptr + *size < *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 …]
|
D | authorization_set.cpp | 299 static bool deserialize(keymaster_key_param_t* param, const uint8_t** buf_ptr, const uint8_t* end, in deserialize() argument 301 if (!copy_uint32_from_buf(buf_ptr, end, ¶m->tag)) in deserialize() 309 return copy_uint32_from_buf(buf_ptr, end, ¶m->enumerated); in deserialize() 312 return copy_uint32_from_buf(buf_ptr, end, ¶m->integer); in deserialize() 315 return copy_uint64_from_buf(buf_ptr, end, ¶m->long_integer); in deserialize() 317 return copy_uint64_from_buf(buf_ptr, end, ¶m->date_time); in deserialize() 320 if (*buf_ptr < end) { in deserialize() 321 param->boolean = static_cast<bool>(**buf_ptr); in deserialize() 322 (*buf_ptr)++; in deserialize() 330 if (!copy_uint32_from_buf(buf_ptr, end, ¶m->blob.data_length) || in deserialize() [all …]
|
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()
|
/system/keymaster/include/keymaster/ |
D | serializable.h | 52 virtual bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) = 0; 130 bool copy_from_buf(const uint8_t** buf_ptr, const uint8_t* end, void* dest, size_t size); 139 bool copy_size_and_data_from_buf(const uint8_t** buf_ptr, const uint8_t* end, size_t* size, 147 inline bool copy_uint32_from_buf(const uint8_t** buf_ptr, const uint8_t* end, T* value) { in copy_uint32_from_buf() argument 149 if (!copy_from_buf(buf_ptr, end, &val, sizeof(val))) in copy_uint32_from_buf() 159 inline bool copy_uint64_from_buf(const uint8_t** buf_ptr, const uint8_t* end, uint64_t* value) { in copy_uint64_from_buf() argument 160 return copy_from_buf(buf_ptr, end, value, sizeof(*value)); in copy_uint64_from_buf() 170 inline bool copy_uint32_array_from_buf(const uint8_t** buf_ptr, const uint8_t* end, in copy_uint32_array_from_buf() argument 172 if (!copy_uint32_from_buf(buf_ptr, end, count)) in copy_uint32_array_from_buf() 175 const uint8_t* array_end = *buf_ptr + *count * sizeof(uint32_t); in copy_uint32_array_from_buf() [all …]
|
D | android_keymaster_messages.h | 106 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override; 110 virtual bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) = 0; 134 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize() 135 return copy_uint32_from_buf(buf_ptr, end, &algorithm); in Deserialize() 153 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize() 154 return copy_uint32_from_buf(buf_ptr, end, &algorithm) && in Deserialize() 155 copy_uint32_from_buf(buf_ptr, end, &purpose); in Deserialize() 191 bool NonErrorDeserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in NonErrorDeserialize() 195 if (!copy_uint32_array_from_buf(buf_ptr, end, &tmp, &results_length)) in NonErrorDeserialize() 219 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) override { in Deserialize() [all …]
|
D | android_keymaster_utils.h | 291 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end) { in Deserialize() 294 if (!copy_size_and_data_from_buf(buf_ptr, end, &key_material_size, &tmp)) { in Deserialize()
|
D | authorization_set.h | 369 bool Deserialize(const uint8_t** buf_ptr, const uint8_t* end); 384 bool DeserializeIndirectData(const uint8_t** buf_ptr, const uint8_t* end); 385 bool DeserializeElementsData(const uint8_t** buf_ptr, const uint8_t* end);
|
/system/core/libprocessgroup/ |
D | processgroup.cpp | 44 char *buf_ptr; member 81 ctx->buf_ptr = ctx->buf; in initCtx() 92 memmove(ctx->buf, ctx->buf_ptr, ctx->buf_len); in refillBuffer() 93 ctx->buf_ptr = ctx->buf; in refillBuffer() 95 ssize_t ret = read(ctx->fd, ctx->buf_ptr + ctx->buf_len, in refillBuffer() 122 while ((eptr = (char *)memchr(ctx->buf_ptr, '\n', ctx->buf_len)) == NULL) { in getOneAppProcess() 135 long pid = strtol(ctx->buf_ptr, &pid_eptr, 10); in getOneAppProcess() 143 ctx->buf_len -= (eptr - ctx->buf_ptr) + 1; in getOneAppProcess() 144 ctx->buf_ptr = eptr + 1; in getOneAppProcess()
|