/system/keymaster/ |
D | auth_encrypted_key_blob.cpp | 34 KeymasterKeyBlob* key_blob) { in SerializeAuthEncryptedBlob() argument 39 if (!key_blob->Reset(size)) in SerializeAuthEncryptedBlob() 42 uint8_t* buf = key_blob->writable_data(); in SerializeAuthEncryptedBlob() 43 const uint8_t* end = key_blob->key_material + key_blob->key_material_size; in SerializeAuthEncryptedBlob() 51 if (buf != key_blob->key_material + key_blob->key_material_size) in SerializeAuthEncryptedBlob() 57 static keymaster_error_t DeserializeUnversionedBlob(const KeymasterKeyBlob& key_blob, in DeserializeUnversionedBlob() argument 62 const uint8_t* tmp = key_blob.key_material; in DeserializeUnversionedBlob() 64 const uint8_t* end = tmp + key_blob.key_material_size; in DeserializeUnversionedBlob() 82 keymaster_error_t DeserializeAuthEncryptedBlob(const KeymasterKeyBlob& key_blob, in DeserializeAuthEncryptedBlob() argument 87 if (!key_blob.key_material || key_blob.key_material_size == 0) in DeserializeAuthEncryptedBlob() [all …]
|
D | integrity_assured_key_blob.cpp | 84 KeymasterKeyBlob* key_blob) { in SerializeIntegrityAssuredBlob() argument 91 if (!key_blob->Reset(size)) in SerializeIntegrityAssuredBlob() 94 uint8_t* p = key_blob->writable_data(); in SerializeIntegrityAssuredBlob() 96 p = key_material.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 97 p = hw_enforced.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 98 p = sw_enforced.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 100 return ComputeHmac(key_blob->key_material, p - key_blob->key_material, hidden, p); in SerializeIntegrityAssuredBlob() 103 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob, in DeserializeIntegrityAssuredBlob() argument 108 const uint8_t* p = key_blob.begin(); in DeserializeIntegrityAssuredBlob() 109 const uint8_t* end = key_blob.end(); in DeserializeIntegrityAssuredBlob() [all …]
|
D | android_keymaster_messages.cpp | 26 static void set_key_blob(keymaster_key_blob_t* key_blob, const void* key_material, size_t length) { in set_key_blob() argument 27 delete[] key_blob->key_material; in set_key_blob() 28 key_blob->key_material = dup_buffer(key_material, length); in set_key_blob() 29 key_blob->key_material_size = length; in set_key_blob() 32 static size_t key_blob_size(const keymaster_key_blob_t& key_blob) { in key_blob_size() argument 33 return sizeof(uint32_t) /* key size */ + key_blob.key_material_size; in key_blob_size() 36 static uint8_t* serialize_key_blob(const keymaster_key_blob_t& key_blob, uint8_t* buf, in serialize_key_blob() argument 38 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob() 41 static bool deserialize_key_blob(keymaster_key_blob_t* key_blob, const uint8_t** buf_ptr, in deserialize_key_blob() argument 43 delete[] key_blob->key_material; in deserialize_key_blob() [all …]
|
D | soft_keymaster_device.cpp | 180 const void* key_params, uint8_t** key_blob, in generate_keypair() argument 186 if (!key_blob || !key_blob_length) in generate_keypair() 226 *key_blob_length = rsp.key_blob.key_material_size; in generate_keypair() 227 *key_blob = static_cast<uint8_t*>(malloc(*key_blob_length)); in generate_keypair() 228 if (!*key_blob) { in generate_keypair() 232 memcpy(*key_blob, rsp.key_blob.key_material, *key_blob_length); in generate_keypair() 240 const size_t key_length, uint8_t** key_blob, in import_keypair() argument 247 if (!key_blob || !key_blob_length) in import_keypair() 267 *key_blob_length = response.key_blob.key_material_size; in import_keypair() 268 *key_blob = static_cast<uint8_t*>(malloc(*key_blob_length)); in import_keypair() [all …]
|
D | keymaster0_engine.cpp | 119 uint8_t* key_blob = 0; in GenerateRsaKey() local 120 if (keymaster0_device_->generate_keypair(keymaster0_device_, TYPE_RSA, ¶ms, &key_blob, in GenerateRsaKey() 125 unique_ptr<uint8_t, Malloc_Delete> key_blob_deleter(key_blob); in GenerateRsaKey() 126 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size); in GenerateRsaKey() 135 uint8_t* key_blob = 0; in GenerateEcKey() local 136 if (keymaster0_device_->generate_keypair(keymaster0_device_, TYPE_EC, ¶ms, &key_blob, in GenerateEcKey() 141 unique_ptr<uint8_t, Malloc_Delete> key_blob_deleter(key_blob); in GenerateEcKey() 142 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size); in GenerateEcKey() 153 uint8_t* key_blob = 0; in ImportKey() local 155 to_import.key_material_size, &key_blob, in ImportKey() [all …]
|
D | android_keymaster.cpp | 175 KeymasterKeyBlob key_blob; in GenerateKey() local 178 response->error = factory->GenerateKey(request.key_description, &key_blob, in GenerateKey() 181 response->key_blob = key_blob.release(); in GenerateKey() 192 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params, in GetKeyCharacteristics() 222 response->error = LoadKey(request.key_blob, request.additional_params, &hw_enforced, in BeginOperation() 245 if (!context_->enforcement_policy()->CreateKeyId(request.key_blob, &key_id)) in BeginOperation() 337 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params, in ExportKey() 374 KeymasterKeyBlob key_blob; in ImportKey() local 376 KeymasterKeyBlob(key_material), &key_blob, in ImportKey() 379 response->key_blob = key_blob.release(); in ImportKey() [all …]
|
D | key_blob_test.cpp | 307 KeymasterKeyBlob key_blob(blob); in TEST_F() local 311 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_, in TEST_F() 316 key_blob, &ciphertext_, &hw_enforced_, &sw_enforced_, &nonce_, &tag_); in TEST_F() 331 KeymasterKeyBlob key_blob(blob); in TEST_F() local 332 EXPECT_NE(nullptr, key_blob.key_material); in TEST_F() 333 EXPECT_EQ(0U, key_blob.key_material_size); in TEST_F() 336 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_, in TEST_F() 340 DeserializeAuthEncryptedBlob(key_blob, &ciphertext_, &hw_enforced_, &sw_enforced_, in TEST_F() 348 KeymasterKeyBlob key_blob(blob); in TEST_F() local 349 EXPECT_EQ(nullptr, key_blob.key_material); in TEST_F() [all …]
|
D | android_keymaster_messages_test.cpp | 143 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 144 rsp.key_blob.key_material_size = array_length(TEST_DATA); in TEST() 158 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 159 rsp.key_blob.key_material_size = array_length(TEST_DATA); in TEST() 166 EXPECT_EQ(0U, deserialized->key_blob.key_material_size); in TEST() 178 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST() 179 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3)); in TEST() 205 EXPECT_EQ(3U, deserialized->key_blob.key_material_size); in TEST() 206 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3)); in TEST() 399 EXPECT_EQ(msg.key_blob.key_material_size, deserialized->key_blob.key_material_size); in TEST() [all …]
|
D | openssl_utils.cpp | 71 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { in EvpKeyToKeyMaterial() argument 76 if (!key_blob->Reset(key_data_size)) in EvpKeyToKeyMaterial() 79 uint8_t* tmp = key_blob->writable_data(); in EvpKeyToKeyMaterial()
|
D | android_keymaster_test_utils.h | 375 uint8_t** key_blob, size_t* key_blob_length) { in counting_generate_keypair() 377 int result = device(dev)->generate_keypair(device(dev), key_type, key_params, key_blob, in counting_generate_keypair() 380 munge_blob(*key_blob, *key_blob_length); in counting_generate_keypair() 385 const size_t key_length, uint8_t** key_blob, in counting_import_keypair() 389 device(dev)->import_keypair(device(dev), key, key_length, key_blob, key_blob_length); in counting_import_keypair() 391 munge_blob(*key_blob, *key_blob_length); in counting_import_keypair() 396 const uint8_t* key_blob, const size_t key_blob_length, in counting_get_keypair_public() 399 std::unique_ptr<uint8_t[]> dup_blob(unmunge_blob(key_blob, key_blob_length)); in counting_get_keypair_public() 404 static int counting_delete_keypair(const struct keymaster0_device* dev, const uint8_t* key_blob, in counting_delete_keypair() 408 std::unique_ptr<uint8_t[]> dup_blob(unmunge_blob(key_blob, key_blob_length)); in counting_delete_keypair() [all …]
|
D | integrity_assured_key_blob.h | 32 KeymasterKeyBlob* key_blob); 34 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob,
|
D | auth_encrypted_key_blob.h | 32 KeymasterKeyBlob* key_blob); 34 keymaster_error_t DeserializeAuthEncryptedBlob(const KeymasterKeyBlob& key_blob,
|
D | ec_keymaster0_key.cpp | 38 KeymasterKeyBlob* key_blob, in GenerateKey() argument 41 if (!key_blob || !hw_enforced || !sw_enforced) in GenerateKey() 45 return super::GenerateKey(key_description, key_blob, hw_enforced, sw_enforced); in GenerateKey() 63 return context_->CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob, in GenerateKey()
|
D | rsa_keymaster0_key.cpp | 40 KeymasterKeyBlob* key_blob, in GenerateKey() argument 43 if (!key_blob || !hw_enforced || !sw_enforced) in GenerateKey() 47 return super::GenerateKey(key_description, key_blob, hw_enforced, sw_enforced); in GenerateKey() 72 return context_->CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob, in GenerateKey()
|
D | symmetric_key.cpp | 35 KeymasterKeyBlob* key_blob, in GenerateKey() argument 38 if (!key_blob || !hw_enforced || !sw_enforced) in GenerateKey() 61 return context_->CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
|
D | ec_key_factory.cpp | 44 KeymasterKeyBlob* key_blob, in GenerateKey() argument 47 if (!key_blob || !hw_enforced || !sw_enforced) in GenerateKey() 87 return context_->CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
|
D | rsa_key_factory.cpp | 53 KeymasterKeyBlob* key_blob, in GenerateKey() argument 56 if (!key_blob || !hw_enforced || !sw_enforced) in GenerateKey() 95 return context_->CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
|
/system/security/keystore/ |
D | keyblob_utils.cpp | 49 uint8_t* add_softkey_header(uint8_t* key_blob, size_t key_blob_length) { in add_softkey_header() argument 54 memcpy(key_blob, SOFT_KEY_MAGIC, sizeof(SOFT_KEY_MAGIC)); in add_softkey_header() 56 return key_blob + sizeof(SOFT_KEY_MAGIC); in add_softkey_header() 59 bool is_softkey(const uint8_t* key_blob, const size_t key_blob_length) { in is_softkey() argument 64 return !memcmp(key_blob, SOFT_KEY_MAGIC, sizeof(SOFT_KEY_MAGIC)); in is_softkey()
|
/system/keymaster/include/keymaster/ |
D | soft_keymaster_device.h | 89 const size_t key_length, uint8_t** key_blob, size_t* key_blob_length); 90 static int get_keypair_public(const keymaster1_device_t* dev, const uint8_t* key_blob, 93 static int delete_keypair(const struct keymaster1_device* dev, const uint8_t* key_blob, 97 const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* data, 101 const uint8_t* key_blob, const size_t key_blob_length, 136 keymaster_key_blob_t* key_blob, 139 const keymaster_key_blob_t* key_blob, 147 keymaster_key_blob_t* key_blob,
|
D | android_keymaster_messages.h | 228 key_blob.key_material = NULL; in KeymasterResponse() 229 key_blob.key_material_size = 0; in KeymasterResponse() 237 keymaster_key_blob_t key_blob; member 245 key_blob.key_material = NULL; in KeymasterMessage() 246 key_blob.key_material_size = 0; in KeymasterMessage() 259 keymaster_key_blob_t key_blob; member 276 key_blob.key_material = NULL; in KeymasterMessage() 277 key_blob.key_material_size = 0; in KeymasterMessage() 279 ~BeginOperationRequest() { delete[] key_blob.key_material; } in ~BeginOperationRequest() 291 keymaster_key_blob_t key_blob; member [all …]
|
D | key_factory.h | 41 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced,
|
D | rsa_key_factory.h | 32 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced,
|
D | ec_key_factory.h | 35 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced,
|
/system/security/keystore/include/keystore/ |
D | keystore.h | 68 uint8_t* add_softkey_header(uint8_t* key_blob, size_t key_blob_length); 73 bool is_softkey(const uint8_t* key_blob, const size_t key_blob_length);
|
/system/security/softkeymaster/include/keymaster/ |
D | softkeymaster.h | 26 const size_t key_length, uint8_t** key_blob, size_t* key_blob_length); 28 int openssl_get_keypair_public(const struct keymaster0_device* dev, const uint8_t* key_blob,
|