Home
last modified time | relevance | path

Searched refs:key_material (Results 1 – 25 of 79) sorted by relevance

1234

/system/keymaster/km_openssl/
Dasymmetric_key_factory.cpp43 keymaster_error_t AsymmetricKeyFactory::LoadKey(KeymasterKeyBlob&& key_material, in LoadKey() argument
53 const uint8_t* tmp = key_material.key_material; in LoadKey()
54 asym_key->key_material() = std::move(key_material); in LoadKey()
57 asym_key->key_material().key_material_size); in LoadKey()
Dsymmetric_key.cpp54 KeymasterKeyBlob key_material(key_data_size); in GenerateKey() local
55 if (!key_material.key_material) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in GenerateKey()
57 error = random_source_.GenerateRandom(key_material.writable_data(), key_data_size); in GenerateKey()
63 return blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, in GenerateKey()
109 SymmetricKey::SymmetricKey(KeymasterKeyBlob&& key_material, AuthorizationSet&& hw_enforced, in SymmetricKey() argument
112 key_material_ = std::move(key_material); in SymmetricKey()
Dcurve25519_key.cpp43 const uint8_t* tmp = key_material().key_material; in InternalToEvp()
45 d2i_PrivateKey(evp_key_type(), nullptr /* pkey */, &tmp, key_material().key_material_size)); in InternalToEvp()
Dwrapped_key.cpp48 if (!ASN1_OCTET_STRING_set(wrapped_key->transit_key, transit_key.key_material, in build_wrapped_key()
51 !ASN1_OCTET_STRING_set(wrapped_key->secure_key, secure_key.key_material, in build_wrapped_key()
91 const uint8_t* tmp = wrapped_key.key_material; in parse_wrapped_key()
102 if (record->transit_key->data && !transit_key->key_material) { in parse_wrapped_key()
107 if (record->secure_key->data && !secure_key->key_material) { in parse_wrapped_key()
Dtriple_des_key.cpp44 keymaster_error_t TripleDesKeyFactory::LoadKey(KeymasterKeyBlob&& key_material, in LoadKey() argument
53 TripleDesKey(std::move(key_material), std::move(hw_enforced), in LoadKey()
/system/keymaster/key_blob_utils/
Dintegrity_assured_key_blob.cpp75 keymaster_error_t SerializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_material, in SerializeIntegrityAssuredBlob() argument
81 key_material.SerializedSize() + // in SerializeIntegrityAssuredBlob()
90 p = key_material.Serialize(p, key_blob->end()); in SerializeIntegrityAssuredBlob()
94 return ComputeHmac(key_blob->key_material, p - key_blob->key_material, hidden, p); in SerializeIntegrityAssuredBlob()
99 KeymasterKeyBlob* key_material, in DeserializeIntegrityAssuredBlob() argument
115 return DeserializeIntegrityAssuredBlob_NoHmacCheck(key_blob, key_material, hw_enforced, in DeserializeIntegrityAssuredBlob()
120 KeymasterKeyBlob* key_material, in DeserializeIntegrityAssuredBlob_NoHmacCheck() argument
131 if (!key_material->Deserialize(&p, end) || // in DeserializeIntegrityAssuredBlob_NoHmacCheck()
Dsoftware_keyblobs.cpp166 KeymasterKeyBlob* key_material, in ParseOldSoftkeymasterBlob() argument
171 const uint8_t* p = blob.key_material; in ParseOldSoftkeymasterBlob()
172 const uint8_t* end = blob.key_material + blob.key_material_size; in ParseOldSoftkeymasterBlob()
227 if (!key_material->Reset(privateLen)) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in ParseOldSoftkeymasterBlob()
228 memcpy(key_material->writable_data(), key_start, privateLen); in ParseOldSoftkeymasterBlob()
238 KeymasterKeyBlob* key_material, in ParseAuthEncryptedBlob() argument
248 *key_material = std::move(*decrypted); in ParseAuthEncryptedBlob()
457 return SerializeIntegrityAssuredBlob(key->key_material(), hidden, key->hw_enforced(), in FullUpgradeSoftKeyBlob()
/system/keymaster/legacy_support/
Dkeymaster_passthrough_engine.cpp87 KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced,
217 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in GenerateKey()
218 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey()
237 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in GenerateKey()
238 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey()
254 const keymaster_blob_t input_key = {input_key_material.key_material, in ImportKey()
261 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in ImportKey()
279 const keymaster_blob_t input_key = {input_key_material.key_material, in ImportKey()
286 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in ImportKey()
288 output_key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in ImportKey()
Dkeymaster_passthrough_key.cpp24 keymaster_error_t KeymasterPassthroughKeyFactory::LoadKey(KeymasterKeyBlob&& key_material, in LoadKey() argument
33 KeymasterPassthroughKey(std::move(key_material), std::move(hw_enforced), in LoadKey()
73 engine_->ExportKey(format, key_material(), client_id, app_data, &export_data); in formatted_key_material()
Dec_keymaster1_key.cpp103 keymaster_error_t EcdsaKeymaster1KeyFactory::LoadKey(KeymasterKeyBlob&& key_material, in LoadKey() argument
112 engine_->BuildEcKey(key_material, additional_params, &error)); in LoadKey()
120 (*key)->key_material() = std::move(key_material); in LoadKey()
Drsa_keymaster1_key.cpp114 keymaster_error_t RsaKeymaster1KeyFactory::LoadKey(KeymasterKeyBlob&& key_material, in LoadKey() argument
122 RSA_Ptr rsa(engine_->BuildRsaKey(key_material, additional_params, &error)); in LoadKey()
130 (*key)->key_material() = std::move(key_material); in LoadKey()
/system/keymaster/contexts/
Dkeymaster1_passthrough_context.cpp120 const AuthorizationSet& additional_params, KeymasterKeyBlob* key_material, in parseKeymaster1HwBlob() argument
140 *key_material = blob; in parseKeymaster1HwBlob()
150 KeymasterKeyBlob key_material; in ParseKeyBlob() local
159 DeserializeIntegrityAssuredBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
163 error = parseKeymaster1HwBlob(km1_engine_->device(), blob, additional_params, &key_material, in ParseKeyBlob()
176 return factory->LoadKey(std::move(key_material), additional_params, std::move(hw_enforced), in ParseKeyBlob()
185 KeymasterKeyBlob key_material; in DeleteKey() local
188 blob, &key_material, &hw_enforced, &sw_enforced); in DeleteKey()
218 const KeymasterKeyBlob& key_material, KeymasterKeyBlob* blob, AuthorizationSet* hw_enforced, in CreateKeyBlob() argument
229 return SerializeIntegrityAssuredBlob(key_material, hidden, *hw_enforced, *sw_enforced, blob); in CreateKeyBlob()
Dsoft_keymaster_context.cpp184 const KeymasterKeyBlob& key_material, in CreateKeyBlob() argument
196 return SerializeIntegrityAssuredBlob(key_material, hidden, *hw_enforced, *sw_enforced, blob); in CreateKeyBlob()
263 KeymasterKeyBlob key_material; in ParseKeyBlob() local
276 return factory->LoadKey(std::move(key_material), additional_params, std::move(hw_enforced), in ParseKeyBlob()
286 DeserializeIntegrityAssuredBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
290 error = ParseAuthEncryptedBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
295 error = ParseOldSoftkeymasterBlob(blob, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
300 error = ParseKeymaster1HwBlob(blob, additional_params, &key_material, &hw_enforced, in ParseKeyBlob()
313 KeymasterKeyBlob key_material; in DeleteKey() local
316 blob, &key_material, &hw_enforced, &sw_enforced); in DeleteKey()
[all …]
Dpure_soft_keymaster_context.cpp179 const KeymasterKeyBlob& key_material, in CreateKeyBlob() argument
253 error = SerializeIntegrityAssuredBlob(key_material, hidden, *hw_enforced, *sw_enforced, blob); in CreateKeyBlob()
302 KeymasterKeyBlob key_material; in ParseKeyBlob() local
328 return factory->LoadKey(std::move(key_material), additional_params, std::move(hw_enforced), in ParseKeyBlob()
339 DeserializeIntegrityAssuredBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
343 error = ParseAuthEncryptedBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
348 error = ParseOldSoftkeymasterBlob(blob, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
523 if (!input.Reinitialize(transit_key.key_material, transit_key.key_material_size)) { in UnwrapKey()
532 KeymasterKeyBlob key_material = {output.peek_read(), output.available_read()}; in UnwrapKey() local
535 if (key_material.key_material_size != masking_key.key_material_size) { in UnwrapKey()
[all …]
/system/keymaster/include/keymaster/key_blob_utils/
Dintegrity_assured_key_blob.h28 keymaster_error_t SerializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_material,
36 KeymasterKeyBlob* key_material,
41 KeymasterKeyBlob* key_material,
/system/keymaster/android_keymaster/
Dandroid_keymaster_messages.cpp31 void set_key_blob(keymaster_key_blob_t* key_blob, const void* key_material, size_t length) { in set_key_blob() argument
32 delete[] key_blob->key_material; in set_key_blob()
33 key_blob->key_material = dup_buffer(key_material, length); in set_key_blob()
43 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob()
48 delete[] key_blob->key_material; in deserialize_key_blob()
49 key_blob->key_material = nullptr; in deserialize_key_blob()
54 key_blob->key_material = deserialized_key_material.release(); in deserialize_key_blob()
377 delete[] key_blob.key_material; in ~GetKeyCharacteristicsRequest()
380 void GetKeyCharacteristicsRequest::SetKeyMaterial(const void* key_material, size_t length) { in SetKeyMaterial() argument
381 set_key_blob(&key_blob, key_material, length); in SetKeyMaterial()
[all …]
/system/keymaster/include/keymaster/km_openssl/
Dhmac_key.h35 keymaster_error_t LoadKey(KeymasterKeyBlob&& key_material,
53 HmacKey(KeymasterKeyBlob&& key_material, AuthorizationSet&& hw_enforced, in HmacKey() argument
55 : SymmetricKey(std::move(key_material), std::move(hw_enforced), std::move(sw_enforced), in HmacKey()
Daes_key.h38 keymaster_error_t LoadKey(KeymasterKeyBlob&& key_material,
55 AesKey(KeymasterKeyBlob&& key_material, AuthorizationSet&& hw_enforced, in AesKey() argument
57 : SymmetricKey(std::move(key_material), std::move(hw_enforced), std::move(sw_enforced), in AesKey()
Dtriple_des_key.h36 keymaster_error_t LoadKey(KeymasterKeyBlob&& key_material,
56 TripleDesKey(KeymasterKeyBlob&& key_material, AuthorizationSet&& hw_enforced, in TripleDesKey() argument
58 : SymmetricKey(std::move(key_material), std::move(hw_enforced), std::move(sw_enforced), in TripleDesKey()
Dcurve25519_key.h43 const KeyFactory* factory, const KeymasterKeyBlob& key_material) in Curve25519Key() argument
45 key_material_ = key_material; in Curve25519Key()
/system/keymaster/include/keymaster/legacy_support/
Dkeymaster1_legacy_support.h106 keymaster_error_t LoadKey(KeymasterKeyBlob&& key_material, in LoadKey() argument
117 return software_digest_factory_.LoadKey(std::move(key_material), additional_params, in LoadKey()
121 return passthrough_factory_.LoadKey(std::move(key_material), additional_params, in LoadKey()
162 KeymasterKeyBlob&& key_material, const AuthorizationSet& additional_params,
167 KeymasterKeyBlob&& key_material, const AuthorizationSet& additional_params,
Dkeymaster_passthrough_key.h66 keymaster_error_t LoadKey(KeymasterKeyBlob&& key_material,
85 KeymasterPassthroughKey(KeymasterKeyBlob&& key_material, AuthorizationSet&& hw_enforced, in KeymasterPassthroughKey() argument
91 key_material_ = std::move(key_material); in KeymasterPassthroughKey()
Dkeymaster1_engine.h45 KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced,
58 : op_handle(0), begin_params(params), key_material(blob), error(KM_ERROR_OK), in KeyData()
64 KeymasterKeyBlob key_material; member
/system/keymint/ta/src/
Dkeys.rs271 let (key_material, chars) = self.generate_key_material(params)?; in generate_key()
276 key_material, in generate_key()
291 let key_material = match keygen_info { in generate_key_material() localVariable
314 Ok((key_material, chars)) in generate_key_material()
329 let (mut chars, key_material) = tag::extract_key_import_characteristics( in import_key()
350 key_material, in import_key()
361 key_material: KeyMaterial, in finish_keyblob_creation()
372 key_material: key_material.clone(), in finish_keyblob_creation()
376 if let Some(spki) = keyblob.key_material.subject_public_key_info( in finish_keyblob_creation()
417 signing_key: attest_keyblob.key_material, in finish_keyblob_creation()
[all …]
/system/keymaster/include/keymaster/
Dandroid_keymaster_messages.h465 key_blob.key_material = nullptr; in GetKeyCharacteristicsRequest()
470 void SetKeyMaterial(const void* key_material, size_t length);
472 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial()
496 key_blob.key_material = nullptr; in BeginOperationRequest()
499 ~BeginOperationRequest() { delete[] key_blob.key_material; } in ~BeginOperationRequest()
501 void SetKeyMaterial(const void* key_material, size_t length);
503 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial()
620 void SetKeyMaterial(const void* key_material, size_t length);
622 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial()
637 key_blob.key_material = nullptr; in ExportKeyRequest()
[all …]

1234