/system/extras/verity/ |
D | generate_verity_key.c | 65 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/ |
D | openssl_utils.cpp | 79 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()
|
D | ec_key.cpp | 27 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()
|
D | asymmetric_key.cpp | 44 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()
|
D | rsa_key.cpp | 26 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()
|
D | asymmetric_key_factory.cpp | 54 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()
|
D | rsa_key_factory.cpp | 83 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()
|
D | ec_key_factory.cpp | 95 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()
|
D | ecdsa_operation.cpp | 35 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()
|
D | attestation_utils.cpp | 313 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()
|
D | rsa_operation.cpp | 45 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/ |
D | asymmetric_key.h | 37 virtual bool InternalToEvp(EVP_PKEY* pkey) const = 0; 38 virtual bool EvpToInternal(const EVP_PKEY* pkey) = 0;
|
D | ec_key.h | 36 bool InternalToEvp(EVP_PKEY* pkey) const override; 37 bool EvpToInternal(const EVP_PKEY* pkey) override;
|
D | rsa_key.h | 32 bool InternalToEvp(EVP_PKEY* pkey) const override; 33 bool EvpToInternal(const EVP_PKEY* pkey) override;
|
D | openssl_utils.h | 88 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey);
|
/system/security/keystore-engine/ |
D | android_engine.cpp | 373 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/ |
D | ecdsa_keymaster1_operation.cpp | 90 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()
|
D | rsa_keymaster1_operation.cpp | 111 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()
|
D | keymaster0_engine.cpp | 173 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()
|
D | keymaster1_engine.cpp | 153 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/ |
D | trusty_keymaster_main.cpp | 258 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()
|
D | trusty_keymaster_device_test.cpp | 493 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/ |
D | auth.cpp | 83 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/ |
D | software_keyblobs.cpp | 220 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/ |
D | android_keymaster_test.cpp | 1106 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()
|