/system/keymaster/include/keymaster/ |
D | android_keymaster_utils.h | 218 key_material = nullptr; in KeymasterKeyBlob() 224 key_material = dup_buffer(data, size); in KeymasterKeyBlob() 225 if (key_material) in KeymasterKeyBlob() 231 key_material = new (std::nothrow) uint8_t[size]; in KeymasterKeyBlob() 232 if (key_material) in KeymasterKeyBlob() 238 key_material = dup_buffer(blob.key_material, blob.key_material_size); in KeymasterKeyBlob() 239 if (key_material) in KeymasterKeyBlob() 245 key_material = dup_buffer(blob.key_material, blob.key_material_size); in KeymasterKeyBlob() 246 if (key_material) in KeymasterKeyBlob() 252 key_material = dup_buffer(blob.key_material, blob.key_material_size); [all …]
|
D | android_keymaster_messages.h | 274 key_blob.key_material = nullptr; in KeymasterResponse() 291 key_blob.key_material = nullptr; in KeymasterMessage() 296 void SetKeyMaterial(const void* key_material, size_t length); 298 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() 322 key_blob.key_material = nullptr; in KeymasterMessage() 325 ~BeginOperationRequest() { delete[] key_blob.key_material; } in ~BeginOperationRequest() 327 void SetKeyMaterial(const void* key_material, size_t length); 329 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() 450 void SetKeyMaterial(const void* key_material, size_t length); 452 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() [all …]
|
D | soft_keymaster_context.h | 68 const KeymasterKeyBlob& key_material, KeymasterKeyBlob* blob, 76 KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced, 100 KeymasterKeyBlob* key_material, 105 KeymasterKeyBlob* key_material, 109 KeymasterKeyBlob* key_material,
|
/system/keymaster/ |
D | symmetric_key.cpp | 51 KeymasterKeyBlob key_material(key_data_size); in GenerateKey() local 52 if (!key_material.key_material) in GenerateKey() 55 error = context_->GenerateRandom(key_material.writable_data(), key_data_size); in GenerateKey() 61 return context_->CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey() 110 SymmetricKey::SymmetricKey(const KeymasterKeyBlob& key_material, in SymmetricKey() argument 117 uint8_t* tmp = dup_buffer(key_material.key_material, key_material.key_material_size); in SymmetricKey() 120 key_data_size_ = key_material.key_material_size; in SymmetricKey() 131 keymaster_error_t SymmetricKey::key_material(UniquePtr<uint8_t[]>* key_material, in key_material() argument 134 key_material->reset(new (std::nothrow) uint8_t[*size]); in key_material() 135 if (!key_material->get()) in key_material() [all …]
|
D | keymaster0_engine.cpp | 98 KeymasterKeyBlob* key_material) const { in GenerateRsaKey() 99 assert(key_material); in GenerateRsaKey() 106 &key_material->key_material_size) < 0) { in GenerateRsaKey() 111 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size); in GenerateRsaKey() 115 bool Keymaster0Engine::GenerateEcKey(uint32_t key_size, KeymasterKeyBlob* key_material) const { in GenerateEcKey() 116 assert(key_material); in GenerateEcKey() 122 &key_material->key_material_size) < 0) { in GenerateEcKey() 127 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size); in GenerateEcKey() 139 if (keymaster0_device_->import_keypair(keymaster0_device_, to_import.key_material, in ImportKey() 146 imported_key->key_material = dup_buffer(key_blob, imported_key->key_material_size); in ImportKey() [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() 38 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob() 43 delete[] key_blob->key_material; in deserialize_key_blob() 44 key_blob->key_material = 0; in deserialize_key_blob() 49 key_blob->key_material = deserialized_key_material.release(); in deserialize_key_blob() 76 delete[] key_blob.key_material; in ~GenerateKeyResponse() 95 delete[] key_blob.key_material; in ~GetKeyCharacteristicsRequest() 98 void GetKeyCharacteristicsRequest::SetKeyMaterial(const void* key_material, size_t length) { in SetKeyMaterial() argument [all …]
|
D | integrity_assured_key_blob.cpp | 80 keymaster_error_t SerializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_material, in SerializeIntegrityAssuredBlob() argument 86 key_material.SerializedSize() + // in SerializeIntegrityAssuredBlob() 96 p = key_material.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 100 return ComputeHmac(key_blob->key_material, p - key_blob->key_material, hidden, p); in SerializeIntegrityAssuredBlob() 105 KeymasterKeyBlob* key_material, in DeserializeIntegrityAssuredBlob() argument 123 return DeserializeIntegrityAssuredBlob_NoHmacCheck(key_blob, key_material, hw_enforced, in DeserializeIntegrityAssuredBlob() 128 KeymasterKeyBlob* key_material, in DeserializeIntegrityAssuredBlob_NoHmacCheck() argument 141 if (!key_material->Deserialize(&p, end) || // in DeserializeIntegrityAssuredBlob_NoHmacCheck()
|
D | soft_keymaster_context.cpp | 451 const KeymasterKeyBlob& key_material, in CreateKeyBlob() argument 465 return SerializeIntegrityAssuredBlob(key_material, hidden, *hw_enforced, *sw_enforced, blob); in CreateKeyBlob() 471 KeymasterKeyBlob key_material; in UpgradeKeyBlob() local 475 ParseKeyBlob(key_to_upgrade, upgrade_params, &key_material, &tee_enforced, &sw_enforced); in UpgradeKeyBlob() 524 return SerializeIntegrityAssuredBlob(key_material, hidden, tee_enforced, sw_enforced, in UpgradeKeyBlob() 530 KeymasterKeyBlob* key_material, in ParseOcbAuthEncryptedBlob() argument 544 nonce, tag, key_material); in ParseOcbAuthEncryptedBlob() 552 const KeymasterKeyBlob& blob, KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced, in ParseOldSoftkeymasterBlob() argument 556 const uint8_t* p = blob.key_material; in ParseOldSoftkeymasterBlob() 557 const uint8_t* end = blob.key_material + blob.key_material_size; in ParseOldSoftkeymasterBlob() [all …]
|
D | asymmetric_key_factory.cpp | 41 keymaster_error_t AsymmetricKeyFactory::LoadKey(const KeymasterKeyBlob& key_material, in LoadKey() argument 51 const uint8_t* tmp = key_material.key_material; in LoadKey() 53 d2i_PrivateKey(evp_key_type(), NULL /* pkey */, &tmp, key_material.key_material_size); in LoadKey()
|
D | ec_keymaster0_key.cpp | 53 KeymasterKeyBlob key_material; in GenerateKey() local 54 if (!engine_->GenerateEcKey(key_size, &key_material)) in GenerateKey() 64 return context_->CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob, in GenerateKey() 100 keymaster_error_t EcdsaKeymaster0KeyFactory::LoadKey(const KeymasterKeyBlob& key_material, in LoadKey() argument 109 return super::LoadKey(key_material, additional_params, hw_enforced, sw_enforced, key); in LoadKey() 111 unique_ptr<EC_KEY, EC_KEY_Delete> ec_key(engine_->BlobToEcKey(key_material)); in LoadKey()
|
D | rsa_keymaster0_key.cpp | 55 KeymasterKeyBlob key_material; in GenerateKey() local 56 if (!engine_->GenerateRsaKey(public_exponent, key_size, &key_material)) in GenerateKey() 66 return context_->CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob, in GenerateKey() 101 keymaster_error_t RsaKeymaster0KeyFactory::LoadKey(const KeymasterKeyBlob& key_material, in LoadKey() argument 110 return super::LoadKey(key_material, additional_params, hw_enforced, sw_enforced, key); in LoadKey() 112 unique_ptr<RSA, RSA_Delete> rsa(engine_->BlobToRsaKey(key_material)); in LoadKey()
|
D | integrity_assured_key_blob.h | 28 keymaster_error_t SerializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_material, 36 KeymasterKeyBlob* key_material, 41 KeymasterKeyBlob* key_material,
|
D | hmac_key.h | 30 keymaster_error_t LoadKey(const KeymasterKeyBlob& key_material, 49 HmacKey(const KeymasterKeyBlob& key_material, const AuthorizationSet& hw_enforced, in HmacKey() argument 51 : SymmetricKey(key_material, hw_enforced, sw_enforced, error) {} in HmacKey()
|
D | aes_key.h | 35 keymaster_error_t LoadKey(const KeymasterKeyBlob& key_material, 53 AesKey(const KeymasterKeyBlob& key_material, const AuthorizationSet& hw_enforced, in AesKey() argument 55 : SymmetricKey(key_material, hw_enforced, sw_enforced, error) {} in AesKey()
|
D | auth_encrypted_key_blob.cpp | 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() 62 const uint8_t* tmp = key_blob.key_material; in DeserializeUnversionedBlob() 87 if (!key_blob.key_material || key_blob.key_material_size == 0) in DeserializeAuthEncryptedBlob() 90 const uint8_t* tmp = key_blob.key_material; in DeserializeAuthEncryptedBlob()
|
D | openssl_utils.cpp | 107 const KeymasterKeyBlob& key_material, in KeyMaterialToEvpKey() argument 113 return convert_pkcs8_blob_to_evp(key_material.key_material, key_material.key_material_size, in KeyMaterialToEvpKey()
|
D | rsa_key_factory.cpp | 90 KeymasterKeyBlob key_material; in GenerateKey() local 91 keymaster_error_t error = EvpKeyToKeyMaterial(pkey.get(), &key_material); in GenerateKey() 95 return context_->CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey() 122 const KeymasterKeyBlob& key_material, in UpdateImportKeyDescription() argument 131 KeyMaterialToEvpKey(key_format, key_material, keymaster_key_type(), &pkey); in UpdateImportKeyDescription()
|
D | symmetric_key.h | 61 virtual keymaster_error_t key_material(UniquePtr<uint8_t[]>* key_material, size_t* size) const; 71 SymmetricKey(const KeymasterKeyBlob& key_material, const AuthorizationSet& hw_enforced,
|
D | ec_key_factory.cpp | 118 KeymasterKeyBlob key_material; in GenerateKey() local 119 error = EvpKeyToKeyMaterial(pkey.get(), &key_material); in GenerateKey() 123 return context_->CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey() 149 const KeymasterKeyBlob& key_material, in UpdateImportKeyDescription() argument 157 KeyMaterialToEvpKey(key_format, key_material, keymaster_key_type(), &pkey); in UpdateImportKeyDescription()
|
D | android_keymaster.cpp | 213 KeymasterKeyBlob key_material; in GetKeyCharacteristics() local 216 &key_material, &response->enforced, &response->unenforced); in GetKeyCharacteristics() 364 KeymasterKeyBlob key_material; in ExportKey() local 367 &key_material, &hw_enforced, &sw_enforced); in ExportKey() 378 response->error = key_factory->LoadKey(key_material, request.additional_params, hw_enforced, in ExportKey() 432 keymaster_key_blob_t key_material = {request.key_data, request.key_data_length}; in ImportKey() local 435 KeymasterKeyBlob(key_material), &key_blob, in ImportKey() 463 KeymasterKeyBlob key_material; in LoadKey() local 465 &key_material, hw_enforced, sw_enforced); in LoadKey() 478 return (*factory)->LoadKey(key_material, additional_params, *hw_enforced, *sw_enforced, key); in LoadKey()
|
D | keymaster1_engine.h | 47 KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced, 60 : op_handle(0), begin_params(params), key_material(blob), error(KM_ERROR_OK), in KeyData() 66 KeymasterKeyBlob key_material; member
|
D | keymaster1_engine.cpp | 91 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in GenerateKey() 92 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey() 108 const keymaster_blob_t input_key = {input_key_material.key_material, in ImportKey() 116 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in ImportKey() 117 output_key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in ImportKey() 155 GetKeymaster1PublicKey(key_data->key_material, key_data->begin_params, error)); in BuildRsaKey()
|
D | aes_key.cpp | 44 keymaster_error_t AesKeyFactory::LoadKey(const KeymasterKeyBlob& key_material, in LoadKey() argument 65 key->reset(new (std::nothrow) AesKey(key_material, hw_enforced, sw_enforced, &error)); in LoadKey()
|
D | hmac_key.cpp | 42 keymaster_error_t HmacKeyFactory::LoadKey(const KeymasterKeyBlob& key_material, in LoadKey() argument 58 key->reset(new (std::nothrow) HmacKey(key_material, hw_enforced, sw_enforced, &error)); in LoadKey()
|
D | android_keymaster_messages_test.cpp | 143 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 158 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 179 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3)); in TEST() 206 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3)); in TEST() 410 EXPECT_EQ(0, memcmp(msg.key_blob.key_material, deserialized->key_blob.key_material, in TEST() 428 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST() 451 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST() 553 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST() 589 EXPECT_EQ(0, memcmp("foo", deserialized->key_blob.key_material, 3)); in TEST() 598 req.upgraded_key.key_material = dup_array(TEST_DATA); in TEST() [all …]
|