/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() 258 bssl::UniquePtr<RSA> rsa(RSA_new_method(g_keystore_engine->engine())); in wrap_rsa() local 259 if (rsa.get() == nullptr) { in wrap_rsa() 268 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_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()
|
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()
|
/system/core/adb/crypto/tests/ |
D | key_test.cpp | 40 auto* rsa = EVP_PKEY_get0_RSA(rsa_2048->GetEvpPkey()); in TEST() local 41 ASSERT_TRUE(CalculatePublicKey(&pub_key_plus_name, rsa)); in TEST() 49 std::vector<uint8_t> sig(RSA_size(rsa)); in TEST() 52 &sig_len, rsa), in TEST()
|
D | rsa_2048_key_test.cpp | 40 auto* rsa = EVP_PKEY_get0_RSA(rsa_2048->GetEvpPkey()); in TEST() local 41 ASSERT_TRUE(CalculatePublicKey(&pub_key_plus_name, rsa)); in TEST() 52 std::vector<uint8_t> sig(RSA_size(rsa)); in TEST() 55 &sig_len, rsa), in TEST()
|
D | x509_generator_test.cpp | 31 auto* rsa = EVP_PKEY_get0_RSA(rsa_2048->GetEvpPkey()); in TEST() local 32 ASSERT_TRUE(CalculatePublicKey(&pub_key_plus_name, rsa)); in TEST()
|
/system/core/adb/crypto/ |
D | rsa_2048_key.cpp | 73 bssl::UniquePtr<RSA> rsa(RSA_new()); in CreateRSA2048Key() local 74 if (!pkey || !exponent || !rsa) { in CreateRSA2048Key() 80 RSA_generate_key_ex(rsa.get(), 2048, exponent.get(), nullptr); in CreateRSA2048Key() 81 EVP_PKEY_set1_RSA(pkey.get(), rsa.get()); in CreateRSA2048Key()
|
/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 | 77 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> rsa(GetRsaKey(move(key), error)); in CreateRsaOperation() local 78 if (!rsa.get()) return nullptr; in CreateRsaOperation() 81 padding, rsa.release()); in CreateRsaOperation() 327 UniquePtr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(rsa_key_))); in SignUndigested() local 328 if (!rsa.get()) in SignUndigested() 331 if (!output->Reinitialize(RSA_size(rsa.get()))) in SignUndigested() 348 bytes_encrypted = RSA_private_encrypt(key_len, to_encrypt, output->peek_write(), rsa.get(), in SignUndigested() 360 output->peek_write(), rsa.get(), RSA_PKCS1_PADDING); in SignUndigested() 434 UniquePtr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(rsa_key_))); in VerifyUndigested() local 435 if (!rsa.get()) in VerifyUndigested() [all …]
|
/system/update_engine/payload_consumer/ |
D | payload_verifier.cc | 206 RSA* rsa = EVP_PKEY_get0_RSA(public_key); in GetRawHashFromSignature() local 208 TEST_AND_RETURN_FALSE(rsa != nullptr); in GetRawHashFromSignature() 209 unsigned int keysize = RSA_size(rsa); in GetRawHashFromSignature() 218 sig_data.size(), sig_data.data(), hash_data.data(), rsa, RSA_NO_PADDING); in GetRawHashFromSignature()
|
D | delta_performer_integration_test.cc | 322 RSA* rsa = RSA_new(); in SignGeneratedShellPayload() local 325 EXPECT_EQ(1, RSA_generate_key_ex(rsa, 2048, e, nullptr)); in SignGeneratedShellPayload() 331 fprikey, rsa, nullptr, nullptr, 0, nullptr, nullptr)); in SignGeneratedShellPayload() 333 RSA_free(rsa); in SignGeneratedShellPayload()
|
/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/update_engine/payload_generator/ |
D | payload_signer.cc | 312 RSA* rsa = EVP_PKEY_get0_RSA(private_key.get()); in SignHash() local 313 TEST_AND_RETURN_FALSE(rsa != nullptr); in SignHash() 316 PayloadVerifier::PadRSASHA256Hash(&padded_hash, RSA_size(rsa)); in SignHash() 318 signature.resize(RSA_size(rsa)); in SignHash() 322 rsa, in SignHash()
|
/system/core/adb/client/ |
D | auth.cpp | 73 RSA* rsa = EVP_PKEY_get0_RSA(rsa_2048->GetEvpPkey()); in generate_key() local 74 CHECK(rsa); in generate_key() 76 if (!CalculatePublicKey(&pubkey, rsa)) { in generate_key()
|
/system/update_engine/ |
D | Android.bp | 572 …cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &… 573 …"openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" + 574 …"openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096…
|
/system/apex/shim/build/ |
D | Android.bp | 264 …cmd: "openssl req -x509 -newkey rsa:4096 -nodes -days 999999 -subj '/DN=/EMAILADDRESS=android@andr… 280 …cmd: "openssl req -x509 -key $(in) -newkey rsa:4096 -nodes -days 999999 -subj '/DN=/EMAILADDRESS=a…
|
/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()
|
/system/apex/docs/ |
D | README.md | 366 Create an rsa key pair.
|