Home
last modified time | relevance | path

Searched refs:key_blob (Results 1 – 25 of 59) sorted by relevance

123

/system/keymaster/key_blob_utils/
Dintegrity_assured_key_blob.cpp79 KeymasterKeyBlob* key_blob) { in SerializeIntegrityAssuredBlob() argument
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()
97 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob, in DeserializeIntegrityAssuredBlob() argument
102 const uint8_t* p = key_blob.begin(); in DeserializeIntegrityAssuredBlob()
103 const uint8_t* end = key_blob.end(); in DeserializeIntegrityAssuredBlob()
[all …]
Dauth_encrypted_key_blob.cpp242 KmErrorOr<DeserializedKey> DeserializeAuthEncryptedBlob(const KeymasterKeyBlob& key_blob) { in DeserializeAuthEncryptedBlob() argument
243 if (!key_blob.key_material || key_blob.key_material_size == 0) return KM_ERROR_INVALID_KEY_BLOB; in DeserializeAuthEncryptedBlob()
245 const uint8_t* tmp = key_blob.key_material; in DeserializeAuthEncryptedBlob()
247 const uint8_t* end = tmp + key_blob.key_material_size; in DeserializeAuthEncryptedBlob()
/system/security/keystore2/src/
Draw_device.rs198 let key_blob = key_entry.take_key_blob_info().and_then(|(key_blob, blob_metadata)| { in lookup_or_generate_key() localVariable
200 Some(key_blob) in lookup_or_generate_key()
206 if let Some(key_blob_vec) = key_blob { in lookup_or_generate_key()
207 let (key_characteristics, key_blob) = self in lookup_or_generate_key()
212 |key_blob| { in lookup_or_generate_key()
221 self.km_dev.getKeyCharacteristics(key_blob, &[], &[]) in lookup_or_generate_key()
228 return Ok((key_id_guard, key_blob)); in lookup_or_generate_key()
247 .map(|(key_blob, _)| KeyBlob::NonSensitive(key_blob)) in lookup_or_generate_key()
260 key_blob: KeyBlob<'a>, in upgrade_keyblob_if_required_with()
266 match f(&key_blob) { in upgrade_keyblob_if_required_with()
[all …]
Dsecurity_level.rs123 keyBlob: key_blob, in store_new_key()
157 blob: Some(key_blob.to_vec()), in store_new_key()
164 let (key_blob, mut blob_metadata) = SUPER_KEY in store_new_key()
174 &key_blob, in store_new_key()
187 &BlobInfo::new(&key_blob, &blob_metadata), in store_new_key()
816 key_blob: &KeyBlob, in store_upgraded_keyblob()
820 SuperKeyManager::reencrypt_if_required(key_blob, upgraded_blob) in store_upgraded_keyblob()
844 key_blob: &KeyBlob, in upgrade_keyblob_if_required_with()
854 key_blob, in upgrade_keyblob_if_required_with()
861 Self::store_upgraded_keyblob(kid, km_uuid, key_blob, upgraded_blob) in upgrade_keyblob_if_required_with()
[all …]
Dsuper_key.rs200 let key_blob = key_entry in decrypt() localVariable
203 .map(|(key_blob, _)| KeyBlob::Ref(key_blob)) in decrypt()
218 &key_blob, in decrypt()
695 key_blob: &[u8], in super_encrypt_on_key_init()
702 Self::encrypt_with_aes_super_key(key_blob, &super_key) in super_encrypt_on_key_init()
717 key_blob: &[u8], in encrypt_with_aes_super_key()
724 let (encrypted_key, iv, tag) = aes_gcm_encrypt(key_blob, &(super_key.key)) in encrypt_with_aes_super_key()
743 key_blob: &[u8], in handle_super_encryption_on_key_init()
746 SuperEncryptionType::None => Ok((key_blob.to_vec(), BlobMetaData::new())), in handle_super_encryption_on_key_init()
748 .super_encrypt_on_key_init(db, legacy_importer, user_id, key_blob) in handle_super_encryption_on_key_init()
[all …]
/system/keymaster/android_keymaster/
Dandroid_keymaster_messages.cpp28 void set_key_blob(keymaster_key_blob_t* key_blob, const void* key_material, size_t length) { in set_key_blob() argument
29 delete[] key_blob->key_material; in set_key_blob()
30 key_blob->key_material = dup_buffer(key_material, length); in set_key_blob()
31 key_blob->key_material_size = length; in set_key_blob()
34 size_t key_blob_size(const keymaster_key_blob_t& key_blob) { in key_blob_size() argument
35 return sizeof(uint32_t) /* key size */ + key_blob.key_material_size; in key_blob_size()
38 uint8_t* serialize_key_blob(const keymaster_key_blob_t& key_blob, uint8_t* buf, in serialize_key_blob() argument
40 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob()
43 bool deserialize_key_blob(keymaster_key_blob_t* key_blob, const uint8_t** buf_ptr, in deserialize_key_blob() argument
45 delete[] key_blob->key_material; in deserialize_key_blob()
[all …]
Dandroid_keymaster.cpp357 &response->key_blob, // in GenerateKey()
429 response->key_blob = std::move(gen_key_response.key_blob); in GenerateRkpKey()
588 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params, &key); in GetKeyCharacteristics()
603 UniquePtr<Key> key = LoadKey(request.key_blob, request.additional_params, &response->error); in BeginOperation()
632 if (!context_->enforcement_policy()->CreateKeyId(request.key_blob, &key_id)) return; in BeginOperation()
792 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params, &key); in ExportKey()
807 UniquePtr<Key> key = LoadKey(request.key_blob, request.attest_params, &response->error); in AttestKey()
825 response->error = context_->UpgradeKeyBlob(KeymasterKeyBlob(request.key_blob), in UpgradeKey()
865 &response->key_blob, // in ImportKey()
873 response->error = context_->DeleteKey(KeymasterKeyBlob(request.key_blob)); in DeleteKey()
[all …]
/system/keymaster/include/keymaster/key_blob_utils/
Dintegrity_assured_key_blob.h32 KeymasterKeyBlob* key_blob);
34 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob,
40 keymaster_error_t DeserializeIntegrityAssuredBlob_NoHmacCheck(const KeymasterKeyBlob& key_blob,
/system/core/trusty/keymaster/include/trusty_keymaster/legacy/
Dtrusty_keymaster_device.h50 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,
/system/keymaster/contexts/
Dsoft_keymaster_device.cpp685 keymaster_key_blob_t* key_blob, keymaster_key_characteristics_t** characteristics) { in generate_key() argument
688 if (!key_blob) return KM_ERROR_OUTPUT_PARAMETER_NULL; in generate_key()
698 return km1_dev->generate_key(km1_dev, params, key_blob, characteristics); in generate_key()
704 key_blob->key_material_size = response.key_blob.key_material_size; in generate_key()
705 uint8_t* tmp = reinterpret_cast<uint8_t*>(malloc(key_blob->key_material_size)); in generate_key()
707 memcpy(tmp, response.key_blob.key_material, response.key_blob.key_material_size); in generate_key()
708 key_blob->key_material = tmp; in generate_key()
727 keymaster_key_blob_t* key_blob, in generate_key() argument
733 if (!key_blob) return KM_ERROR_OUTPUT_PARAMETER_NULL; in generate_key()
764 keymaster_error_t error = km1_dev->generate_key(km1_dev, &request.key_description, key_blob, in generate_key()
[all …]
/system/keymaster/tests/
Dkey_blob_test.cpp325 KeymasterKeyBlob key_blob(blob); in TEST_P() local
329 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_, in TEST_P()
333 auto deserialized = DeserializeAuthEncryptedBlob(key_blob); in TEST_P()
352 KeymasterKeyBlob key_blob(blob); in TEST_P() local
353 EXPECT_NE(nullptr, key_blob.key_material); in TEST_P()
354 EXPECT_EQ(0U, key_blob.key_material_size); in TEST_P()
357 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_, in TEST_P()
360 auto deserialized = DeserializeAuthEncryptedBlob(key_blob); in TEST_P()
369 KeymasterKeyBlob key_blob(blob); in TEST_P() local
370 EXPECT_EQ(nullptr, key_blob.key_material); in TEST_P()
[all …]
Dandroid_keymaster_messages_test.cpp107 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()
174 rsp.key_blob.key_material_size = array_length(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()
184 deserialized->key_blob.key_material_size)); in TEST()
[all …]
/system/keymaster/km_openssl/
Dopenssl_utils.cpp117 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { in EvpKeyToKeyMaterial() argument
132 if (!key_blob->Reset(data_len)) { in EvpKeyToKeyMaterial()
136 memcpy(key_blob->writable_data(), data, data_len); in EvpKeyToKeyMaterial()
144 if (!key_blob->Reset(key_data_size)) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in EvpKeyToKeyMaterial()
146 uint8_t* tmp = key_blob->writable_data(); in EvpKeyToKeyMaterial()
Dsymmetric_key.cpp38 KeymasterKeyBlob* key_blob, in GenerateKey() argument
42 if (!key_blob || !hw_enforced || !sw_enforced) return KM_ERROR_OUTPUT_PARAMETER_NULL; in GenerateKey()
62 return blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
Dsoft_keymaster_enforcement.cpp70 bool SoftKeymasterEnforcement::CreateKeyId(const keymaster_key_blob_t& key_blob, in CreateKeyId() argument
77 EVP_DigestUpdate(ctx.get(), key_blob.key_material, key_blob.key_material_size) && in CreateKeyId()
Drsa_key_factory.cpp56 KeymasterKeyBlob* key_blob, in GenerateKey() argument
60 if (!key_blob || !hw_enforced || !sw_enforced) return KM_ERROR_OUTPUT_PARAMETER_NULL; in GenerateKey()
99 error = blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
/system/keymaster/include/keymaster/
Dsoft_keymaster_device.h131 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,
Dandroid_keymaster_messages.h368 : KeymasterResponse(ver), key_blob{}, certificate_chain{} {} in GenerateKeyResponse()
374 KeymasterKeyBlob key_blob; member
401 KeymasterKeyBlob key_blob; member
465 key_blob.key_material = nullptr; in GetKeyCharacteristicsRequest()
466 key_blob.key_material_size = 0; in GetKeyCharacteristicsRequest()
479 keymaster_key_blob_t key_blob; member
496 key_blob.key_material = nullptr; in BeginOperationRequest()
497 key_blob.key_material_size = 0; in BeginOperationRequest()
499 ~BeginOperationRequest() { delete[] key_blob.key_material; } in ~BeginOperationRequest()
511 keymaster_key_blob_t key_blob; member
[all …]
/system/keymaster/legacy_support/
Dkeymaster_passthrough_engine.cpp208 const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, in GenerateKey() argument
210 assert(key_blob); in GenerateKey()
218 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey()
219 key_blob->key_material_size = blob.key_material_size; in GenerateKey()
228 const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, in GenerateKey() argument
230 assert(key_blob); in GenerateKey()
238 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey()
239 key_blob->key_material_size = blob.key_material_size; in GenerateKey()
Dec_keymaster1_key.cpp69 KeymasterKeyBlob* key_blob, in GenerateKey() argument
84 return engine_->GenerateKey(key_params_copy, key_blob, hw_enforced, sw_enforced); in GenerateKey()
Drsa_keymaster1_key.cpp89 KeymasterKeyBlob* key_blob, in GenerateKey() argument
95 return engine_->GenerateKey(key_params_copy, key_blob, hw_enforced, sw_enforced); in GenerateKey()
/system/keymaster/include/keymaster/legacy_support/
Dkeymaster1_legacy_support.h70 KeymasterKeyBlob* key_blob, // in GenerateKey() argument
76 issuer_subject, key_blob, hw_enforced, in GenerateKey()
80 issuer_subject, key_blob, hw_enforced, in GenerateKey()
155 KeymasterKeyBlob* key_blob, //
Dkeymaster_passthrough_key.h48 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, in GenerateKey() argument
51 return engine_->GenerateKey(key_description, key_blob, hw_enforced, sw_enforced); in GenerateKey()
/system/keymint/common/
Dgenerated.cddl250 key_blob: bstr,
273 key_blob: bstr,
451 key_blob: bstr,
460 key_blob: bstr,
483 key_blob: bstr,
/system/keymaster/include/keymaster/km_openssl/
Dsoft_keymaster_enforcement.h40 bool CreateKeyId(const keymaster_key_blob_t& key_blob, km_id_t* keyid) const override;

123