/aosp12/system/keymaster/key_blob_utils/ |
H A D | integrity_assured_key_blob.cpp | 86 if (!key_blob->Reset(size)) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in SerializeIntegrityAssuredBlob() 88 uint8_t* p = key_blob->writable_data(); in SerializeIntegrityAssuredBlob() 90 p = key_material.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 91 p = hw_enforced.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 92 p = sw_enforced.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob() 94 return ComputeHmac(key_blob->key_material, p - key_blob->key_material, hidden, p); in SerializeIntegrityAssuredBlob() 102 const uint8_t* p = key_blob.begin(); in DeserializeIntegrityAssuredBlob() 103 const uint8_t* end = key_blob.end(); in DeserializeIntegrityAssuredBlob() 108 keymaster_error_t error = ComputeHmac(key_blob.begin(), key_blob.key_material_size - HMAC_SIZE, in DeserializeIntegrityAssuredBlob() 123 const uint8_t* p = key_blob.begin(); in DeserializeIntegrityAssuredBlob_NoHmacCheck() [all …]
|
/aosp12/system/keymaster/android_keymaster/ |
H A D | android_keymaster_messages.cpp | 29 delete[] key_blob->key_material; in set_key_blob() 31 key_blob->key_material_size = length; in set_key_blob() 40 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob() 45 delete[] key_blob->key_material; in deserialize_key_blob() 46 key_blob->key_material = nullptr; in deserialize_key_blob() 214 buf = serialize_key_blob(key_blob, buf, end); in NonErrorSerialize() 314 delete[] key_blob.key_material; in ~GetKeyCharacteristicsRequest() 584 key_blob_size(key_blob); in SerializedSize() 628 return key_blob_size(key_blob); in SerializedSize() 665 delete[] key_blob.key_material; in ~AttestKeyRequest() [all …]
|
H A D | android_keymaster.cpp | 339 &response->key_blob, // in GenerateKey() 402 response->key_blob = std::move(gen_key_response.key_blob); in GenerateRkpKey() 542 UniquePtr<Key> key = LoadKey(request.key_blob, request.additional_params, &response->error); in BeginOperation() 567 if (!context_->enforcement_policy()->CreateKeyId(request.key_blob, &key_id)) return; in BeginOperation() 738 UniquePtr<Key> key = LoadKey(request.key_blob, request.attest_params, &response->error); in AttestKey() 756 response->error = context_->UpgradeKeyBlob(KeymasterKeyBlob(request.key_blob), in UpgradeKey() 789 &response->key_blob, // in ImportKey() 797 response->error = context_->DeleteKey(KeymasterKeyBlob(request.key_blob)); in DeleteKey() 828 UniquePtr<Key> AndroidKeymaster::LoadKey(const keymaster_key_blob_t& key_blob, in LoadKey() argument 835 *error = context_->ParseKeyBlob(KeymasterKeyBlob(key_blob), additional_params, &key); in LoadKey() [all …]
|
/aosp12/system/security/keystore2/src/ |
H A D | raw_device.rs | 193 let key_blob = key_entry.take_key_blob_info().and_then(|(key_blob, blob_metadata)| { in lookup_or_generate_key() localVariable 195 Some(key_blob) in lookup_or_generate_key() 201 if let Some(key_blob_vec) = key_blob { in lookup_or_generate_key() 207 |key_blob| { in lookup_or_generate_key() 223 return Ok((key_id_guard, key_blob)); in lookup_or_generate_key() 242 .map(|(key_blob, _)| KeyBlob::NonSensitive(key_blob)) in lookup_or_generate_key() 255 key_blob: KeyBlob<'a>, in upgrade_keyblob_if_required_with() 261 match f(&key_blob) { in upgrade_keyblob_if_required_with() 295 key_blob, in upgrade_keyblob_if_required_with() 307 key_blob: &[u8], in use_key_in_one_step() [all …]
|
H A D | security_level.rs | 120 keyBlob: key_blob, in store_new_key() 155 blob: Some(key_blob.to_vec()), in store_new_key() 170 &key_blob, in store_new_key() 799 key_blob: &KeyBlob, in store_upgraded_keyblob() 827 key_blob: &KeyBlob, in upgrade_keyblob_if_required_with() 835 match f(key_blob) { in upgrade_keyblob_if_required_with() 853 key_blob, in upgrade_keyblob_if_required_with() 875 key_blob, in upgrade_keyblob_if_required_with() 876 key_blob, in upgrade_keyblob_if_required_with() 901 let key_blob = storage_key in convert_storage_key_to_ephemeral() localVariable [all …]
|
H A D | super_key.rs | 198 let key_blob = key_entry in decrypt() localVariable 201 .map(|(key_blob, _)| KeyBlob::Ref(key_blob)) in decrypt() 216 &key_blob, in decrypt() 687 key_blob: &[u8], in super_encrypt_on_key_init() 693 Self::encrypt_with_aes_super_key(key_blob, &super_key) in super_encrypt_on_key_init() 708 key_blob: &[u8], in encrypt_with_aes_super_key() 716 let (encrypted_key, iv, tag) = aes_gcm_encrypt(key_blob, &(super_key.key)) in encrypt_with_aes_super_key() 735 key_blob: &[u8], in handle_super_encryption_on_key_init() 738 SuperEncryptionType::None => Ok((key_blob.to_vec(), BlobMetaData::new())), in handle_super_encryption_on_key_init() 740 .super_encrypt_on_key_init(db, legacy_migrator, user_id, &key_blob) in handle_super_encryption_on_key_init() [all …]
|
/aosp12/hardware/interfaces/security/keymint/aidl/vts/functional/ |
H A D | DeviceUniqueAttestationTest.cpp | 39 ASSERT_GT(key_blob.size(), 0U); in CheckUniqueAttestationResults() 69 vector<uint8_t> key_blob; in TEST_P() local 83 &key_blob, &key_characteristics); in TEST_P() 97 vector<uint8_t> key_blob; in TEST_P() local 110 &key_blob, &key_characteristics); in TEST_P() 124 vector<uint8_t> key_blob; in TEST_P() local 138 &key_blob, &key_characteristics); in TEST_P() 182 vector<uint8_t> key_blob; in TEST_P() local 194 &key_blob, &key_characteristics); in TEST_P() 244 vector<uint8_t> key_blob; in TEST_P() local [all …]
|
H A D | KeyMintAidlTestBase.h | 97 const string& key_material, vector<uint8_t>* key_blob, 116 ErrorCode GetCharacteristics(const vector<uint8_t>& key_blob, 119 void CheckCharacteristics(const vector<uint8_t>& key_blob, 125 ErrorCode DeleteKey(vector<uint8_t>* key_blob, bool keep_key_blob = false); 132 void CheckedDeleteKey(vector<uint8_t>* key_blob, bool keep_key_blob = false); 135 ErrorCode Begin(KeyPurpose purpose, const vector<uint8_t>& key_blob, 138 ErrorCode Begin(KeyPurpose purpose, const vector<uint8_t>& key_blob, 157 string ProcessMessage(const vector<uint8_t>& key_blob, KeyPurpose operation, 163 string SignMessage(const vector<uint8_t>& key_blob, const string& message, 179 void VerifyMessage(const vector<uint8_t>& key_blob, const string& message, [all …]
|
H A D | KeyMintTest.cpp | 862 vector<uint8_t> key_blob; in TEST_P() local 903 vector<uint8_t> key_blob; in TEST_P() local 977 vector<uint8_t> key_blob; in TEST_P() local 1036 vector<uint8_t> key_blob; in TEST_P() local 1090 CheckedDeleteKey(&key_blob); in TEST_P() 1147 vector<uint8_t> key_blob; in TEST_P() local 1176 vector<uint8_t> key_blob; in TEST_P() local 1205 CheckedDeleteKey(&key_blob); in TEST_P() 1666 vector<uint8_t> key_blob; in TEST_P() local 1700 CheckedDeleteKey(&key_blob); in TEST_P() [all …]
|
H A D | KeyMintAidlTestBase.cpp | 228 vector<uint8_t>* key_blob, in GenerateKey() argument 241 *key_blob = std::move(creationResult.keyBlob); in GenerateKey() 278 key_blob->clear(); in ImportKey() 290 *key_blob = std::move(creationResult.keyBlob); in ImportKey() 372 const vector<uint8_t>& key_blob, in CheckCharacteristics() argument 381 ASSERT_EQ(ErrorCode::OK, GetCharacteristics(key_blob, &retrieved)); in CheckCharacteristics() 386 const vector<uint8_t>& key_blob, std::string_view app_id_string, in CheckAppIdCharacteristics() argument 416 Status result = keymint_->deleteKey(*key_blob); in DeleteKey() 418 *key_blob = vector<uint8_t>(); in DeleteKey() 441 ErrorCode result = DeleteKey(key_blob, keep_key_blob); in CheckedDeleteKey() [all …]
|
/aosp12/hardware/interfaces/keymaster/4.0/vts/functional/ |
H A D | KeymasterHidlTest.cpp | 80 *key_blob = hidl_key_blob; in GenerateKey() 86 EXPECT_EQ(0U, key_blob->size()); in GenerateKey() 106 *key_blob = hidl_key_blob; in ImportKey() 112 EXPECT_EQ(0U, key_blob->size()); in ImportKey() 168 auto rc = keymaster_->deleteKey(*key_blob); in DeleteKey() 169 if (!keep_key_blob) *key_blob = HidlBuf(); in DeleteKey() 184 auto rc = DeleteKey(key_blob, keep_key_blob); in CheckedDeleteKey() 226 key_blob, client_id, app_data, in GetCharacteristics() 375 ErrorCode KeymasterHidlTest::AttestKey(const HidlBuf& key_blob, in AttestKey() argument 381 key_blob, attest_params.hidl_data(), in AttestKey() [all …]
|
H A D | KeymasterHidlTest.h | 99 ErrorCode GenerateKey(const AuthorizationSet& key_desc, HidlBuf* key_blob, 104 const string& key_material, HidlBuf* key_blob, 117 ErrorCode DeleteKey(HidlBuf* key_blob, bool keep_key_blob = false); 122 void CheckedDeleteKey(HidlBuf* key_blob, bool keep_key_blob = false); 125 void CheckGetCharacteristics(const HidlBuf& key_blob, const HidlBuf& client_id, 127 ErrorCode GetCharacteristics(const HidlBuf& key_blob, const HidlBuf& client_id, 155 ErrorCode AttestKey(const HidlBuf& key_blob, const AuthorizationSet& attest_params, 163 string SignMessage(const HidlBuf& key_blob, const string& message, 184 string EncryptMessage(const HidlBuf& key_blob, const string& message, 197 string DecryptMessage(const HidlBuf& key_blob, const string& ciphertext, [all …]
|
/aosp12/hardware/libhardware/include/hardware/ |
H A D | keymaster1.h | 57 const void* key_params, uint8_t** key_blob, size_t* key_blob_length); 67 const size_t key_length, uint8_t** key_blob, size_t* key_blob_length); 76 int (*get_keypair_public)(const struct keymaster1_device* dev, const uint8_t* key_blob, 88 int (*delete_keypair)(const struct keymaster1_device* dev, const uint8_t* key_blob, 109 const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* data, 119 const uint8_t* key_blob, const size_t key_blob_length, 284 keymaster_key_blob_t* key_blob, 310 const keymaster_key_blob_t* key_blob, 361 keymaster_key_blob_t* key_blob,
|
H A D | keymaster2.h | 114 keymaster_key_blob_t* key_blob, 140 const keymaster_key_blob_t* key_blob, 190 keymaster_key_blob_t* key_blob,
|
/aosp12/system/keymaster/tests/ |
H A D | key_blob_test.cpp | 314 KeymasterKeyBlob key_blob(blob); in TEST_F() local 323 auto deserialized = DeserializeAuthEncryptedBlob(key_blob, &error); in TEST_F() 337 KeymasterKeyBlob key_blob(blob); in TEST_F() local 338 EXPECT_NE(nullptr, key_blob.key_material); in TEST_F() 339 EXPECT_EQ(0U, key_blob.key_material_size); in TEST_F() 342 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_, in TEST_F() 346 DeserializeAuthEncryptedBlob(key_blob, &error); in TEST_F() 354 KeymasterKeyBlob key_blob(blob); in TEST_F() local 355 EXPECT_EQ(nullptr, key_blob.key_material); in TEST_F() 356 EXPECT_EQ(0U, key_blob.key_material_size); in TEST_F() [all …]
|
H A D | android_keymaster_messages_test.cpp | 107 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 108 rsp.key_blob.key_material_size = array_length(TEST_DATA); in TEST() 147 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 148 rsp.key_blob.key_material_size = array_length(TEST_DATA); in TEST() 155 EXPECT_EQ(0U, deserialized->key_blob.key_material_size); in TEST() 173 rsp.key_blob.key_material = dup_array(TEST_DATA); in TEST() 182 EXPECT_EQ(deserialized->key_blob.key_material_size, rsp.key_blob.key_material_size); in TEST() 183 EXPECT_EQ(0, std::memcmp(deserialized->key_blob.key_material, rsp.key_blob.key_material, in TEST() 525 EXPECT_EQ(msg.key_blob.key_material_size, deserialized->key_blob.key_material_size); in TEST() 526 EXPECT_EQ(0, memcmp(msg.key_blob.key_material, deserialized->key_blob.key_material, in TEST() [all …]
|
/aosp12/system/keymaster/contexts/ |
H A D | soft_keymaster_device.cpp | 702 key_blob->key_material_size = response.key_blob.key_material_size; in generate_key() 705 memcpy(tmp, response.key_blob.key_material, response.key_blob.key_material_size); in generate_key() 706 key_blob->key_material = tmp; in generate_key() 778 key_blob->key_material_size = response.key_blob.key_material_size; in generate_key() 781 memcpy(tmp, response.key_blob.key_material, response.key_blob.key_material_size); in generate_key() 782 key_blob->key_material = tmp; in generate_key() 797 if (!dev || !key_blob || !key_blob->key_material) return KM_ERROR_UNEXPECTED_NULL_POINTER; in get_key_characteristics() 814 request.SetKeyMaterial(*key_blob); in get_key_characteristics() 890 key_blob->key_material_size = response.key_blob.key_material_size; in import_key() 891 key_blob->key_material = reinterpret_cast<uint8_t*>(malloc(key_blob->key_material_size)); in import_key() [all …]
|
/aosp12/system/core/trusty/keymaster/include/trusty_keymaster/legacy/ |
H A D | trusty_keymaster_device.h | 50 keymaster_key_blob_t* key_blob, 52 keymaster_error_t get_key_characteristics(const keymaster_key_blob_t* key_blob, 58 const keymaster_blob_t* key_data, keymaster_key_blob_t* key_blob, 101 keymaster_key_blob_t* key_blob, 104 const keymaster_key_blob_t* key_blob, 112 keymaster_key_blob_t* key_blob,
|
/aosp12/hardware/qcom/keymaster/ |
H A D | keymaster_qcom.h | 107 qcom_km_key_blob_t key_blob; member 142 qcom_km_key_blob_t key_blob; member 162 qcom_km_key_blob_t key_blob; member 201 qcom_km_key_blob_t key_blob; member
|
/aosp12/system/keymaster/include/keymaster/key_blob_utils/ |
H A D | integrity_assured_key_blob.h | 32 KeymasterKeyBlob* key_blob); 34 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob, 40 keymaster_error_t DeserializeIntegrityAssuredBlob_NoHmacCheck(const KeymasterKeyBlob& key_blob,
|
/aosp12/system/keymaster/include/keymaster/ |
H A D | android_keymaster_messages.h | 361 KeymasterKeyBlob key_blob; member 388 KeymasterKeyBlob key_blob; member 426 key_blob.key_material_size = 0; in GetKeyCharacteristicsRequest() 439 keymaster_key_blob_t key_blob; member 471 keymaster_key_blob_t key_blob; member 589 KeymasterKeyBlob key_blob; member 613 keymaster_key_blob_t key_blob; member 649 keymaster_key_blob_t key_blob; member 698 keymaster_key_blob_t key_blob; member 725 keymaster_key_blob_t key_blob; member [all …]
|
H A D | soft_keymaster_device.h | 131 keymaster_key_blob_t* key_blob, 134 const keymaster_key_blob_t* key_blob, 142 keymaster_key_blob_t* key_blob, 180 keymaster_key_blob_t* key_blob, 183 const keymaster_key_blob_t* key_blob, 191 keymaster_key_blob_t* key_blob,
|
/aosp12/system/keymaster/legacy_support/ |
H A D | keymaster_passthrough_engine.cpp | 206 const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, in GenerateKey() argument 208 assert(key_blob); in GenerateKey() 216 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey() 217 key_blob->key_material_size = blob.key_material_size; in GenerateKey() 226 const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, in GenerateKey() argument 228 assert(key_blob); in GenerateKey() 236 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey() 237 key_blob->key_material_size = blob.key_material_size; in GenerateKey()
|
/aosp12/system/keymaster/include/keymaster/legacy_support/ |
H A D | keymaster1_legacy_support.h | 69 KeymasterKeyBlob* key_blob, // in GenerateKey() argument 75 issuer_subject, key_blob, hw_enforced, in GenerateKey() 79 issuer_subject, key_blob, hw_enforced, in GenerateKey() 150 KeymasterKeyBlob* key_blob, //
|
/aosp12/system/keymaster/km_openssl/ |
H A D | symmetric_key.cpp | 36 KeymasterKeyBlob* key_blob, in GenerateKey() argument 40 if (!key_blob || !hw_enforced || !sw_enforced) return KM_ERROR_OUTPUT_PARAMETER_NULL; in GenerateKey() 60 return blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
|