/system/extras/verity/ |
D | generate_verity_key.c | 66 RSA *rsa = NULL; in convert_x509() local 91 rsa = EVP_PKEY_get1_RSA(pkey); in convert_x509() 92 if (!rsa) { in convert_x509() 97 if (write_public_keyfile(rsa, key_file) < 0) { in convert_x509() 114 if (rsa) { in convert_x509() 115 RSA_free(rsa); in convert_x509() 125 RSA* rsa = RSA_new(); in generate_key() local 129 if (!pkey || !exponent || !rsa) { in generate_key() 135 RSA_generate_key_ex(rsa, 2048, exponent, NULL); in generate_key() 136 EVP_PKEY_set1_RSA(pkey, rsa); in generate_key() [all …]
|
/system/security/keystore-engine/ |
D | android_engine.cpp | 85 const char* rsa_get_key_id(const RSA* rsa); 91 int rsa_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, size_t len) { in rsa_private_transform() argument 92 ALOGV("rsa_private_transform(%p, %p, %p, %u)", rsa, out, in, (unsigned) len); in rsa_private_transform() 96 const char *key_id = rsa_get_key_id(rsa); in rsa_private_transform() 135 ALOGV("rsa=%p keystore_rsa_priv_dec successful", rsa); in rsa_private_transform() 244 const char* rsa_get_key_id(const RSA* rsa) { in rsa_get_key_id() argument 246 RSA_get_ex_data(rsa, g_keystore_engine->rsa_ex_index())); in rsa_get_key_id() 279 Unique_RSA rsa(RSA_new_method(g_keystore_engine->engine())); in wrap_rsa() local 280 if (rsa.get() == nullptr) { in wrap_rsa() 289 if (!RSA_set_ex_data(rsa.get(), g_keystore_engine->rsa_ex_index(), in wrap_rsa() [all …]
|
/system/keymaster/legacy_support/ |
D | keymaster0_engine.cpp | 164 unique_ptr<RSA, RSA_Delete> rsa(RSA_new_method(engine_)); in BlobToRsaKey() local 165 if (!rsa) in BlobToRsaKey() 169 if (!blob_copy->key_material || !RSA_set_ex_data(rsa.get(), rsa_index_, blob_copy)) in BlobToRsaKey() 179 rsa->n = BN_dup(public_rsa->n); in BlobToRsaKey() 180 rsa->e = BN_dup(public_rsa->e); in BlobToRsaKey() 181 if (!rsa->n || !rsa->e) in BlobToRsaKey() 184 return rsa.release(); in BlobToRsaKey() 213 const keymaster_key_blob_t* Keymaster0Engine::RsaKeyToBlob(const RSA* rsa) const { in RsaKeyToBlob() 214 return reinterpret_cast<keymaster_key_blob_t*>(RSA_get_ex_data(rsa, rsa_index_)); in RsaKeyToBlob() 245 int Keymaster0Engine::rsa_private_transform(RSA* rsa, uint8_t* out, const uint8_t* in, size_t len) { in rsa_private_transform() argument [all …]
|
D | keymaster1_engine.cpp | 139 unique_ptr<RSA, RSA_Delete> rsa(RSA_new_method(engine_.get())); in BuildRsaKey() local 140 if (!rsa) { in BuildRsaKey() 146 if (!RSA_set_ex_data(rsa.get(), rsa_index_, key_data)) { in BuildRsaKey() 164 rsa->n = BN_dup(public_rsa->n); in BuildRsaKey() 165 rsa->e = BN_dup(public_rsa->e); in BuildRsaKey() 166 if (!rsa->n || !rsa->e) { in BuildRsaKey() 172 return rsa.release(); in BuildRsaKey() 217 unique_ptr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(key)); in GetData() local 218 return GetData(rsa.get()); in GetData() 231 Keymaster1Engine::KeyData* Keymaster1Engine::GetData(const RSA* rsa) const { in GetData() [all …]
|
D | rsa_keymaster1_operation.cpp | 129 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> rsa(GetEvpKey(rsa_km1_key, error)); in CreateOperation() local 130 if (!rsa) return nullptr; in CreateOperation() 135 key.hw_enforced_move(), key.sw_enforced_move(), digest, padding, rsa.release(), in CreateOperation() 139 key.hw_enforced_move(), key.sw_enforced_move(), digest, padding, rsa.release(), in CreateOperation()
|
D | rsa_keymaster1_key.cpp | 110 RSA_Ptr rsa(engine_->BuildRsaKey(key_material, additional_params, &error)); in LoadKey() local 111 if (!rsa.get()) in LoadKey() 115 RsaKeymaster1Key(rsa.release(), move(hw_enforced), move(sw_enforced), this)); in LoadKey()
|
D | rsa_keymaster0_key.cpp | 113 unique_ptr<RSA, RSA_Delete> rsa(engine_->BlobToRsaKey(key_material)); in LoadKey() local 114 if (!rsa) in LoadKey() 118 RsaKeymaster0Key(rsa.release(), move(hw_enforced), move(sw_enforced), this)); in LoadKey()
|
/system/update_engine/payload_consumer/ |
D | payload_verifier.cc | 104 RSA* rsa = PEM_read_bio_RSA_PUBKEY(bp, nullptr, nullptr, dummy_password); in GetRawHashFromSignature() local 107 TEST_AND_RETURN_FALSE(rsa != nullptr); in GetRawHashFromSignature() 108 unsigned int keysize = RSA_size(rsa); in GetRawHashFromSignature() 111 RSA_free(rsa); in GetRawHashFromSignature() 118 sig_data.size(), sig_data.data(), hash_data.data(), rsa, RSA_NO_PADDING); in GetRawHashFromSignature() 119 RSA_free(rsa); in GetRawHashFromSignature()
|
D | delta_performer_integration_test.cc | 219 RSA* rsa = RSA_new(); in SignGeneratedShellPayload() local 222 EXPECT_EQ(1, RSA_generate_key_ex(rsa, 2048, e, nullptr)); in SignGeneratedShellPayload() 228 fprikey, rsa, nullptr, nullptr, 0, nullptr, nullptr)); in SignGeneratedShellPayload() 230 RSA_free(rsa); in SignGeneratedShellPayload()
|
/system/keymaster/include/keymaster/legacy_support/ |
D | keymaster0_engine.h | 60 const keymaster_key_blob_t* RsaKeyToBlob(const RSA* rsa) const; 61 const keymaster_key_blob_t* EcKeyToBlob(const EC_KEY* rsa) const; 75 static int rsa_private_transform(RSA* rsa, uint8_t* out, const uint8_t* in, size_t len); 88 int RsaPrivateTransform(RSA* rsa, uint8_t* out, const uint8_t* in, size_t len) const;
|
D | keymaster1_engine.h | 77 KeyData* GetData(const RSA* rsa) const; 78 KeyData* GetData(const EC_KEY* rsa) const; 103 static int rsa_sign_raw(RSA* rsa, size_t* out_len, uint8_t* out, size_t max_out, 105 static int rsa_decrypt(RSA* rsa, size_t* out_len, uint8_t* out, size_t max_out,
|
/system/keymaster/include/keymaster/km_openssl/ |
D | rsa_key.h | 45 RsaKey(RSA* rsa, AuthorizationSet&& hw_enforced, AuthorizationSet&& sw_enforced, in RsaKey() argument 47 : AsymmetricKey(move(hw_enforced), move(sw_enforced), key_factory), rsa_key_(rsa) {} in RsaKey()
|
/system/keymaster/km_openssl/ |
D | rsa_operation.cpp | 74 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> rsa(GetRsaKey(move(key), error)); in CreateRsaOperation() local 75 if (!rsa.get()) return nullptr; in CreateRsaOperation() 78 padding, rsa.release()); in CreateRsaOperation() 324 UniquePtr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(rsa_key_))); in SignUndigested() local 325 if (!rsa.get()) in SignUndigested() 328 if (!output->Reinitialize(RSA_size(rsa.get()))) in SignUndigested() 345 bytes_encrypted = RSA_private_encrypt(key_len, to_encrypt, output->peek_write(), rsa.get(), in SignUndigested() 357 output->peek_write(), rsa.get(), RSA_PKCS1_PADDING); in SignUndigested() 431 UniquePtr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(rsa_key_))); in VerifyUndigested() local 432 if (!rsa.get()) in VerifyUndigested() [all …]
|
/system/netd/resolv/dns_responder/ |
D | dns_tls_frontend.cpp | 89 bssl::UniquePtr<RSA> rsa(RSA_new()); in make_private_key() local 90 if (!rsa) { in make_private_key() 94 if (!RSA_generate_key_ex(rsa.get(), 2048, e.get(), nullptr)) { in make_private_key() 104 if(!EVP_PKEY_assign_RSA(privkey.get(), rsa.get())) { in make_private_key() 110 rsa.release(); in make_private_key()
|
/system/update_engine/payload_generator/ |
D | payload_signer.cc | 283 RSA* rsa = PEM_read_RSAPrivateKey(fprikey, nullptr, nullptr, nullptr); in SignHash() local 285 TEST_AND_RETURN_FALSE(rsa != nullptr); in SignHash() 288 PayloadVerifier::PadRSASHA256Hash(&padded_hash, RSA_size(rsa)); in SignHash() 290 brillo::Blob signature(RSA_size(rsa)); in SignHash() 294 rsa, in SignHash() 296 RSA_free(rsa); in SignHash()
|
/system/keymaster/key_blob_utils/ |
D | software_keyblobs.cpp | 121 RSA_Ptr rsa(EVP_PKEY_get1_RSA(pubkey)); in FakeKeyAuthorizations() local 122 if (!rsa) in FakeKeyAuthorizations() 124 hw_enforced->push_back(TAG_KEY_SIZE, RSA_size(rsa.get()) * 8); in FakeKeyAuthorizations() 125 uint64_t public_exponent = BN_get_word(rsa->e); in FakeKeyAuthorizations()
|
/system/core/adb/client/ |
D | auth.cpp | 85 RSA* rsa = RSA_new(); in generate_key() local 86 if (!pkey || !exponent || !rsa) { in generate_key() 92 RSA_generate_key_ex(rsa, 2048, exponent, nullptr); in generate_key() 93 EVP_PKEY_set1_RSA(pkey, rsa); in generate_key() 116 RSA_free(rsa); in generate_key()
|
/system/update_engine/ |
D | Android.bp | 584 …cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &… 585 …"openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" + 586 …"openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096…
|
/system/keymaster/tests/ |
D | android_keymaster_test.cpp | 2129 unique_ptr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(pkey.get())); in TEST_P() local 2131 size_t modulus_len = BN_num_bytes(rsa->n); in TEST_P() 2134 BN_bn2bin(rsa->n, modulus_buf.get()); in TEST_P() 2149 BN_sub(rsa->n, rsa->n, BN_value_one()); in TEST_P() 2150 modulus_len = BN_num_bytes(rsa->n); in TEST_P() 2152 BN_bn2bin(rsa->n, modulus_buf.get()); in TEST_P()
|