Home
last modified time | relevance | path

Searched refs:key_data (Results 1 – 25 of 35) sorted by relevance

12

/system/keymaster/legacy_support/
Dkeymaster1_engine.cpp138 KeyData* key_data = new (std::nothrow) KeyData(blob, additional_params); in BuildRsaKey() local
139 if (!RSA_set_ex_data(rsa.get(), rsa_index_, key_data)) { in BuildRsaKey()
141 delete key_data; in BuildRsaKey()
147 GetKeymaster1PublicKey(key_data->key_material, key_data->begin_params, error)); in BuildRsaKey()
180 KeyData* key_data = new (std::nothrow) KeyData(blob, additional_params); in BuildEcKey() local
181 if (!EC_KEY_set_ex_data(ec_key.get(), ec_key_index_, key_data)) { in BuildEcKey()
183 delete key_data; in BuildEcKey()
256 keymaster_error_t Keymaster1Engine::Keymaster1Finish(const KeyData* key_data, in Keymaster1Finish() argument
259 if (key_data->op_handle == 0) return KM_ERROR_UNKNOWN_ERROR; in Keymaster1Finish()
265 device()->update(device(), key_data->op_handle, &key_data->finish_params, &input, in Keymaster1Finish()
[all …]
Decdsa_keymaster1_operation.cpp32 Keymaster1Engine::KeyData* key_data = engine_->GetData(ecdsa_key); in Begin() local
33 if (!key_data) return KM_ERROR_UNKNOWN_ERROR; in Begin()
53 return engine_->device()->begin(engine_->device(), purpose_, &key_data->key_material, in Begin()
60 Keymaster1Engine::KeyData* key_data = engine_->GetData(ecdsa_key); in PrepareFinish() local
61 if (!key_data) { in PrepareFinish()
65 key_data->op_handle = operation_handle_; in PrepareFinish()
66 key_data->finish_params.Reinitialize(input_params); in PrepareFinish()
76 Keymaster1Engine::KeyData* key_data = engine_->GetData(ecdsa_key); in GetError() local
77 if (!key_data) return KM_ERROR_UNKNOWN_ERROR; in GetError()
78 return key_data->error; in GetError()
Drsa_keymaster1_operation.cpp32 Keymaster1Engine::KeyData* key_data = engine_->GetData(rsa_key); in Begin() local
33 if (!key_data) return KM_ERROR_UNKNOWN_ERROR; in Begin()
64 key_data->expected_openssl_padding = RSA_NO_PADDING; in Begin()
70 key_data->expected_openssl_padding = RSA_PKCS1_PADDING; in Begin()
74 return engine_->device()->begin(engine_->device(), purpose_, &key_data->key_material, in Begin()
81 Keymaster1Engine::KeyData* key_data = engine_->GetData(rsa_key); in PrepareFinish() local
82 if (!key_data) { in PrepareFinish()
86 key_data->op_handle = operation_handle_; in PrepareFinish()
87 key_data->finish_params.Reinitialize(input_params); in PrepareFinish()
97 Keymaster1Engine::KeyData* key_data = engine_->GetData(rsa_key); // key_data is owned by rsa in GetError() local
[all …]
/system/core/libcrypto_utils/tests/
Dandroid_pubkey_test.cpp126 uint8_t key_data[ANDROID_PUBKEY_ENCODED_SIZE]; in TEST_F() local
127 ASSERT_TRUE(android_pubkey_encode(key_.get(), key_data, sizeof(key_data))); in TEST_F()
128 ASSERT_EQ(0, memcmp(kKey2048, key_data, sizeof(kKey2048))); in TEST_F()
/system/extras/verity/
Dgenerate_verity_key.c36 uint8_t key_data[ANDROID_PUBKEY_ENCODED_SIZE]; in write_public_keyfile() local
44 if (!android_pubkey_encode(private_key, key_data, sizeof(key_data))) in write_public_keyfile()
51 BIO_write(bfile, key_data, sizeof(key_data)); in write_public_keyfile()
/system/core/trusty/keymaster/set_attestation_key/
Dset_attestation_key.cpp76 size_t SerializedSize() const override { return sizeof(uint32_t) + key_data.SerializedSize(); } in SerializedSize()
79 return key_data.Serialize(buf, end); in Serialize()
83 key_data.Deserialize(buf_ptr, end); in Deserialize()
87 keymaster::Buffer key_data; member
119 const void* key_data, size_t key_data_size) { in set_attestation_key_or_cert_bin() argument
124 req.key_data.Reinitialize(key_data, key_data_size); in set_attestation_key_or_cert_bin()
/system/keymint/common/src/
Dtag.rs293 key_data: &[u8], in extract_key_import_characteristics()
297 check_rsa_import_params(&*imp.rsa, params, sec_level, key_format, key_data) in extract_key_import_characteristics()
299 Algorithm::Ec => check_ec_import_params(&*imp.ec, params, sec_level, key_format, key_data), in extract_key_import_characteristics()
301 check_aes_import_params(&*imp.aes, params, sec_level, key_format, key_data) in extract_key_import_characteristics()
303 Algorithm::TripleDes => check_3des_import_params(&*imp.des, params, key_format, key_data), in extract_key_import_characteristics()
305 check_hmac_import_params(&*imp.hmac, params, sec_level, key_format, key_data) in extract_key_import_characteristics()
415 key_data: &[u8], in check_rsa_import_params()
425 let (key, key_size, public_exponent) = rsa.import_pkcs8_key(key_data, params)?; in check_rsa_import_params()
532 key_data: &[u8], in check_ec_import_params()
542 (ec.import_raw_x25519_key(key_data, params)?, EcCurve::Curve25519) in check_ec_import_params()
[all …]
/system/keymaster/km_openssl/
Dopenssl_utils.cpp69 keymaster_error_t convert_pkcs8_blob_to_evp(const uint8_t* key_data, size_t key_length, in convert_pkcs8_blob_to_evp() argument
72 if (key_data == nullptr || key_length <= 0) return KM_ERROR_INVALID_KEY_BLOB; in convert_pkcs8_blob_to_evp()
75 d2i_PKCS8_PRIV_KEY_INFO(nullptr, &key_data, key_length)); in convert_pkcs8_blob_to_evp()
/system/security/keystore2/src/
Dkm_compat.rs55 fn new(key_format: KeyFormat, key_data: &'a [u8]) -> binder::Result<Self> { in new()
57 KeyFormat::PKCS8 => Ok(KeyImportData::Pkcs8(key_data)), in new()
58 KeyFormat::RAW => Ok(KeyImportData::Raw(key_data)), in new()
239 key_data: &[u8], in importKey()
242 if self.emu.emulation_required(key_params, &KeyImportData::new(key_format, key_data)?) { in importKey()
244 self.soft.importKey(key_params, key_format, key_data, attestation_key)?; in importKey()
248 self.real.importKey(key_params, key_format, key_data, attestation_key) in importKey()
Dsecurity_level.rs638 key_data: &[u8], in import_key()
682 km_dev.importKey(&params, format, key_data, None /* attestKey */) in import_key()
1023 key_data: &[u8], in importKey()
1026 let result = self.import_key(key, attestation_key, params, flags, key_data); in importKey()
/system/core/trusty/keymaster/include/trusty_keymaster/legacy/
Dtrusty_keymaster_device.h58 const keymaster_blob_t* key_data, keymaster_key_blob_t* key_blob,
111 const keymaster_blob_t* key_data,
/system/core/fs_mgr/libfs_avb/tests/
Dfs_avb_test_util.cpp264 std::string key_data; in ExtractPublicKeyAvbBlob() local
265 EXPECT_TRUE(base::ReadFileToString(tmp_path, &key_data)); in ExtractPublicKeyAvbBlob()
266 return key_data; in ExtractPublicKeyAvbBlob()
Davb_util_test.cpp428 uint8_t key_data[key_size]; in TEST_F() local
429 EXPECT_EQ(key_size, base::ReadFile(key_path, (char*)key_data, key_size)); in TEST_F()
433 EXPECT_TRUE(ValidatePublicKeyBlob(key_data, key_size, expected_key_blob)); in TEST_F()
435 key_data[10] ^= 0x80; // toggles a bit and expects a failure in TEST_F()
436 EXPECT_FALSE(ValidatePublicKeyBlob(key_data, key_size, expected_key_blob)); in TEST_F()
437 key_data[10] ^= 0x80; // toggles the bit again, should pass in TEST_F()
438 EXPECT_TRUE(ValidatePublicKeyBlob(key_data, key_size, expected_key_blob)); in TEST_F()
446 uint8_t key_data[key_size]; in TEST_F() local
447 EXPECT_EQ(key_size, base::ReadFile(key_path, (char*)key_data, key_size)); in TEST_F()
450 EXPECT_TRUE(ValidatePublicKeyBlob(key_data, key_size, expected_key_blob)); in TEST_F()
/system/keymaster/android_keymaster/
Dandroid_keymaster_messages.cpp580 + key_blob_size(key_data); in SerializedSize()
591 buf = serialize_key_blob(key_data, buf, end); in Serialize()
601 deserialize_key_blob(&key_data, buf_ptr, end))) { in Deserialize()
663 delete[] key_data; in SetKeyMaterial()
664 key_data = dup_buffer(key_material, length); in SetKeyMaterial()
673 return append_size_and_data_to_buf(buf, end, key_data, key_data_length); in NonErrorSerialize()
677 delete[] key_data; in NonErrorDeserialize()
678 key_data = nullptr; in NonErrorDeserialize()
682 key_data = deserialized_key_material.release(); in NonErrorDeserialize()
/system/core/trusty/keymaster/keymint/
DTrustyKeyMintDevice.cpp169 request.key_data = KeymasterKeyBlob(keyData.data(), keyData.size()); in importKey()
322 if (response.key_data) { in convertStorageKeyToEphemeral()
323 *ephemeralKeyBlob = {response.key_data, response.key_data + response.key_data_length}; in convertStorageKeyToEphemeral()
/system/keymaster/include/keymaster/
Dsoft_keymaster_device.h141 const keymaster_blob_t* key_data,
190 const keymaster_blob_t* key_data,
/system/keymaster/include/keymaster/legacy_support/
Dkeymaster1_engine.h93 keymaster_error_t Keymaster1Finish(const KeyData* key_data, const keymaster_blob_t& input,
/system/keymaster/contexts/
Dsoft_keymaster_device.cpp866 keymaster_key_format_t key_format, const keymaster_blob_t* key_data, in import_key() argument
868 if (!params || !key_data) return KM_ERROR_UNEXPECTED_NULL_POINTER; in import_key()
880 return km1_dev->import_key(km1_dev, params, key_format, key_data, key_blob, in import_key()
886 request.key_data = KeymasterKeyBlob(key_data->data, key_data->data_length); in import_key()
908 keymaster_key_format_t key_format, const keymaster_blob_t* key_data, in import_key() argument
919 error = import_key(&sk_dev->km1_device_, params, key_format, key_data, key_blob, in import_key()
926 error = import_key(&sk_dev->km1_device_, params, key_format, key_data, key_blob, nullptr); in import_key()
964 memcpy(tmp, response.key_data, export_data->data_length); in export_key()
/system/keymaster/include/keymaster/km_openssl/
Dopenssl_utils.h89 keymaster_error_t convert_pkcs8_blob_to_evp(const uint8_t* key_data, size_t key_length,
/system/keymaster/tests/
Dkey_blob_test.cpp41 const uint8_t key_data[5] = {21, 22, 23, 24, 25}; variable
49 : key_material_(key_data, array_length(key_data)), in KeyBlobTest()
Dandroid_keymaster_messages_test.cpp519 msg.key_data = KeymasterKeyBlob(reinterpret_cast<const uint8_t*>("foo"), 3); in TEST()
528 EXPECT_EQ(msg.key_data.key_material_size, deserialized->key_data.key_material_size); in TEST()
529 EXPECT_EQ(0, memcmp(msg.key_data.key_material, deserialized->key_data.key_material, in TEST()
530 msg.key_data.key_material_size)); in TEST()
611 EXPECT_EQ(0, memcmp("foo", deserialized->key_data, 3)); in TEST()
/system/core/trusty/keymaster/3.0/
DTrustyKeymaster3Device.cpp280 request.key_data = KeymasterKeyBlob(keyData.data(), keyData.size()); in importKey()
311 resultKeyBlob.setToExternal(response.key_data, response.key_data_length); in exportKey()
/system/keymint/common/src/crypto/
Dec.rs647 let key_data = hex::decode(concat!( in test_sec1_ec_import() localVariable
666 let key = import_sec1_private_key(&key_data).expect("SEC1 parse failed"); in test_sec1_ec_import()
/system/keymaster/ng/
DAndroidKeymaster3Device.cpp330 request.key_data = KeymasterKeyBlob(keyData.data(), keyData.size()); in importKey()
361 resultKeyBlob.setToExternal(response.key_data, response.key_data_length); in exportKey()
/system/keymint/ta/src/
Dkeys.rs321 key_data: &[u8], in import_key()
335 key_data, in import_key()

12