Home
last modified time | relevance | path

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

/system/extras/verity/
Dgenerate_verity_key.c65 EVP_PKEY *pkey = NULL; in convert_x509() local
85 pkey = X509_get_pubkey(cert); in convert_x509()
86 if (!pkey) { in convert_x509()
91 rsa = EVP_PKEY_get1_RSA(pkey); in convert_x509()
111 if (pkey) { in convert_x509()
112 EVP_PKEY_free(pkey); in convert_x509()
127 EVP_PKEY* pkey = EVP_PKEY_new(); in generate_key() local
129 if (!pkey || !exponent || !rsa) { in generate_key()
136 EVP_PKEY_set1_RSA(pkey, rsa); in generate_key()
144 if (!PEM_write_PrivateKey(f, pkey, NULL, NULL, 0, NULL, NULL)) { in generate_key()
[all …]
/system/keymaster/km_openssl/
Dopenssl_utils.cpp79 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) { in convert_pkcs8_blob_to_evp() argument
88 pkey->reset(EVP_PKCS82PKEY(pkcs8.get())); in convert_pkcs8_blob_to_evp()
89 if (!pkey->get()) in convert_pkcs8_blob_to_evp()
92 if (EVP_PKEY_type((*pkey)->type) != convert_to_evp(expected_algorithm)) { in convert_pkcs8_blob_to_evp()
93 LOG_E("EVP key algorithm was %d, not the expected %d", EVP_PKEY_type((*pkey)->type), in convert_pkcs8_blob_to_evp()
104 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) { in KeyMaterialToEvpKey() argument
109 expected_algorithm, pkey); in KeyMaterialToEvpKey()
112 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { in EvpKeyToKeyMaterial() argument
113 int key_data_size = i2d_PrivateKey(pkey, nullptr /* key_data*/); in EvpKeyToKeyMaterial()
121 i2d_PrivateKey(pkey, &tmp); in EvpKeyToKeyMaterial()
Dec_key.cpp27 bool EcKey::EvpToInternal(const EVP_PKEY* pkey) { in EvpToInternal() argument
28 ec_key_.reset(EVP_PKEY_get1_EC_KEY(const_cast<EVP_PKEY*>(pkey))); in EvpToInternal()
32 bool EcKey::InternalToEvp(EVP_PKEY* pkey) const { in InternalToEvp()
33 return EVP_PKEY_set1_EC_KEY(pkey, ec_key_.get()) == 1; in InternalToEvp()
Dasymmetric_key.cpp44 EVP_PKEY_Ptr pkey(EVP_PKEY_new()); in formatted_key_material() local
45 if (!InternalToEvp(pkey.get())) in formatted_key_material()
48 int key_data_length = i2d_PUBKEY(pkey.get(), nullptr); in formatted_key_material()
57 if (i2d_PUBKEY(pkey.get(), &tmp) != key_data_length) { in formatted_key_material()
Drsa_key.cpp26 bool RsaKey::EvpToInternal(const EVP_PKEY* pkey) { in EvpToInternal() argument
27 rsa_key_.reset(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(pkey))); in EvpToInternal()
31 bool RsaKey::InternalToEvp(EVP_PKEY* pkey) const { in InternalToEvp()
32 return EVP_PKEY_set1_RSA(pkey, rsa_key_.get()) == 1; in InternalToEvp()
Dasymmetric_key_factory.cpp54 EVP_PKEY* pkey = in LoadKey() local
57 if (!pkey) in LoadKey()
59 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey_deleter(pkey); in LoadKey()
61 if (!asym_key->EvpToInternal(pkey)) in LoadKey()
Drsa_key_factory.cpp83 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in GenerateKey() local
84 if (exponent.get() == nullptr || rsa_key.get() == nullptr || pkey.get() == nullptr) in GenerateKey()
91 if (EVP_PKEY_set1_RSA(pkey.get(), rsa_key.get()) != 1) in GenerateKey()
95 keymaster_error_t error = EvpKeyToKeyMaterial(pkey.get(), &key_material); in GenerateKey()
133 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey; in UpdateImportKeyDescription() local
135 KeyMaterialToEvpKey(key_format, key_material, keymaster_key_type(), &pkey); in UpdateImportKeyDescription()
139 UniquePtr<RSA, RsaKey::RSA_Delete> rsa_key(EVP_PKEY_get1_RSA(pkey.get())); in UpdateImportKeyDescription()
Dec_key_factory.cpp95 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in GenerateKey() local
96 if (ec_key.get() == nullptr || pkey.get() == nullptr) in GenerateKey()
115 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get()) != 1) in GenerateKey()
119 error = EvpKeyToKeyMaterial(pkey.get(), &key_material); in GenerateKey()
155 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey; in UpdateImportKeyDescription() local
157 KeyMaterialToEvpKey(key_format, key_material, keymaster_key_type(), &pkey); in UpdateImportKeyDescription()
161 UniquePtr<EC_KEY, EC_KEY_Delete> ec_key(EVP_PKEY_get1_EC_KEY(pkey.get())); in UpdateImportKeyDescription()
Decdsa_operation.cpp35 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in CreateOperation() local
36 if (!ecdsa_key.InternalToEvp(pkey.get())) { in CreateOperation()
46 digest, pkey.release())); in CreateOperation()
Dattestation_utils.cpp313 EVP_PKEY_Ptr pkey(EVP_PKEY_new()); in generate_attestation() local
314 if (!key.InternalToEvp(pkey.get())) in generate_attestation()
370 if (!add_public_key(pkey.get(), certificate.get(), &error) || in generate_attestation()
Drsa_operation.cpp45 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in GetRsaKey() local
46 if (!rsa_key.InternalToEvp(pkey.get())) { in GetRsaKey()
50 return pkey.release(); in GetRsaKey()
/system/keymaster/include/keymaster/km_openssl/
Dasymmetric_key.h37 virtual bool InternalToEvp(EVP_PKEY* pkey) const = 0;
38 virtual bool EvpToInternal(const EVP_PKEY* pkey) = 0;
Dec_key.h36 bool InternalToEvp(EVP_PKEY* pkey) const override;
37 bool EvpToInternal(const EVP_PKEY* pkey) override;
Drsa_key.h32 bool InternalToEvp(EVP_PKEY* pkey) const override;
33 bool EvpToInternal(const EVP_PKEY* pkey) override;
Dopenssl_utils.h88 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey);
/system/security/keystore-engine/
Dandroid_engine.cpp373 Unique_EVP_PKEY pkey(d2i_PUBKEY(nullptr, &inp, pubkey_len)); in EVP_PKEY_from_keystore() local
374 if (pkey.get() == nullptr) { in EVP_PKEY_from_keystore()
380 switch (EVP_PKEY_type(pkey->type)) { in EVP_PKEY_from_keystore()
382 Unique_RSA public_rsa(EVP_PKEY_get1_RSA(pkey.get())); in EVP_PKEY_from_keystore()
387 Unique_EC_KEY public_ecdsa(EVP_PKEY_get1_EC_KEY(pkey.get())); in EVP_PKEY_from_keystore()
392 ALOGE("Unsupported key type %d", EVP_PKEY_type(pkey->type)); in EVP_PKEY_from_keystore()
/system/keymaster/legacy_support/
Decdsa_keymaster1_operation.cpp90 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in GetEvpKey() local
91 if (!key.InternalToEvp(pkey.get())) { in GetEvpKey()
95 return pkey.release(); in GetEvpKey()
Drsa_keymaster1_operation.cpp111 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in GetEvpKey() local
112 if (!key.InternalToEvp(pkey.get())) { in GetEvpKey()
116 return pkey.release(); in GetEvpKey()
Dkeymaster0_engine.cpp173 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob)); in BlobToRsaKey() local
174 if (!pkey) in BlobToRsaKey()
176 unique_ptr<RSA, RSA_Delete> public_rsa(EVP_PKEY_get1_RSA(pkey.get())); in BlobToRsaKey()
198 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob)); in BlobToEcKey() local
199 if (!pkey) in BlobToEcKey()
202 unique_ptr<EC_KEY, EC_KEY_Delete> public_ec_key(EVP_PKEY_get1_EC_KEY(pkey.get())); in BlobToEcKey()
Dkeymaster1_engine.cpp153 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in BuildRsaKey() local
158 unique_ptr<RSA, RSA_Delete> public_rsa(EVP_PKEY_get1_RSA(pkey.get())); in BuildRsaKey()
193 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in BuildEcKey() local
198 unique_ptr<EC_KEY, EC_KEY_Delete> public_ec_key(EVP_PKEY_get1_EC_KEY(pkey.get())); in BuildEcKey()
/system/core/trusty/keymaster/legacy/
Dtrusty_keymaster_main.cpp258 std::unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in test_rsa() local
260 std::unique_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_Delete> ctx(EVP_PKEY_CTX_new(pkey.get(), NULL)); in test_rsa()
265 if (EVP_PKEY_type(pkey->type) != EVP_PKEY_RSA) { in test_rsa()
362 std::unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in test_ecdsa() local
364 std::unique_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_Delete> ctx(EVP_PKEY_CTX_new(pkey.get(), NULL)); in test_ecdsa()
369 if (EVP_PKEY_type(pkey->type) != EVP_PKEY_EC) { in test_ecdsa()
Dtrusty_keymaster_device_test.cpp493 std::unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(d2i_PUBKEY(NULL, &key, key_len)); in VerifySignature() local
494 ASSERT_TRUE(pkey.get() != NULL); in VerifySignature()
495 std::unique_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_Delete> ctx(EVP_PKEY_CTX_new(pkey.get(), NULL)); in VerifySignature()
498 if (EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) in VerifySignature()
/system/core/adb/client/
Dauth.cpp83 EVP_PKEY* pkey = EVP_PKEY_new(); in generate_key() local
86 if (!pkey || !exponent || !rsa) { in generate_key()
93 EVP_PKEY_set1_RSA(pkey, rsa); in generate_key()
106 if (!PEM_write_PrivateKey(f, pkey, nullptr, nullptr, 0, nullptr, nullptr)) { in generate_key()
115 EVP_PKEY_free(pkey); in generate_key()
/system/keymaster/key_blob_utils/
Dsoftware_keyblobs.cpp220 EVP_PKEY_Ptr pkey(d2i_PrivateKey(type, nullptr, &p, privateLen)); in ParseOldSoftkeymasterBlob() local
221 if (pkey.get() == nullptr) { in ParseOldSoftkeymasterBlob()
229 keymaster_error_t error = FakeKeyAuthorizations(pkey.get(), sw_enforced, sw_enforced); in ParseOldSoftkeymasterBlob()
/system/keymaster/tests/
Dandroid_keymaster_test.cpp1106 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in TEST_P() local
1108 ASSERT_TRUE(pkey.get()); in TEST_P()
1114 pkey.get())); in TEST_P()
1201 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in TEST_P() local
1203 ASSERT_TRUE(pkey.get()); in TEST_P()
1209 pkey.get())); in TEST_P()
2127 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey( in TEST_P() local
2129 unique_ptr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(pkey.get())); in TEST_P()