Home
last modified time | relevance | path

Searched refs:rsa (Results 1 – 18 of 18) sorted by relevance

/system/extras/verity/
Dgenerate_verity_key.c66 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/keymaster/legacy_support/
Dkeymaster1_engine.cpp132 unique_ptr<RSA, RSA_Delete> rsa(RSA_new_method(engine_.get())); in BuildRsaKey() local
133 if (!rsa) { in BuildRsaKey()
139 if (!RSA_set_ex_data(rsa.get(), rsa_index_, key_data)) { in BuildRsaKey()
156 rsa->n = BN_dup(public_rsa->n); in BuildRsaKey()
157 rsa->e = BN_dup(public_rsa->e); in BuildRsaKey()
158 if (!rsa->n || !rsa->e) { in BuildRsaKey()
164 return rsa.release(); in BuildRsaKey()
208 unique_ptr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(key)); in GetData() local
209 return GetData(rsa.get()); in GetData()
222 Keymaster1Engine::KeyData* Keymaster1Engine::GetData(const RSA* rsa) const { in GetData()
[all …]
Drsa_keymaster1_operation.cpp126 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> rsa(GetEvpKey(rsa_km1_key, error)); in CreateOperation() local
127 if (!rsa) return nullptr; in CreateOperation()
132 key.hw_enforced_move(), key.sw_enforced_move(), digest, padding, rsa.release(), in CreateOperation()
136 key.hw_enforced_move(), key.sw_enforced_move(), digest, padding, rsa.release(), in CreateOperation()
Drsa_keymaster1_key.cpp119 RSA_Ptr rsa(engine_->BuildRsaKey(key_material, additional_params, &error)); in LoadKey() local
120 if (!rsa.get()) return error; in LoadKey()
123 RsaKeymaster1Key(rsa.release(), move(hw_enforced), move(sw_enforced), this)); in LoadKey()
/system/security/keystore-engine/
Dkeystore2_engine.cpp83 extern "C" int rsa_private_transform(RSA* rsa, uint8_t* out, const uint8_t* in, size_t len);
135 bssl::UniquePtr<RSA> rsa(RSA_new_method(Keystore2Engine::get().engine())); in wrap_rsa() local
136 if (rsa.get() == nullptr) { in wrap_rsa()
142 if (!RSA_set_ex_data(rsa.get(), Keystore2Engine::get().rsa_ex_index(), key_backend_copy)) { in wrap_rsa()
147 rsa->n = BN_dup(public_rsa->n); in wrap_rsa()
148 rsa->e = BN_dup(public_rsa->e); in wrap_rsa()
149 if (rsa->n == nullptr || rsa->e == nullptr) { in wrap_rsa()
154 if (result.get() == nullptr || !EVP_PKEY_assign_RSA(result.get(), rsa.get())) { in wrap_rsa()
157 OWNERSHIP_TRANSFERRED(rsa); in wrap_rsa()
257 extern "C" int rsa_private_transform(RSA* rsa, uint8_t* out, const uint8_t* in, size_t len) { in rsa_private_transform() argument
[all …]
/system/keymaster/include/keymaster/legacy_support/
Dkeymaster1_engine.h75 KeyData* GetData(const RSA* rsa) const;
76 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/
Drsa_key.h45 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/
Drsa_operation.cpp76 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> rsa(GetRsaKey(key, error)); in CreateRsaOperation() local
77 if (!rsa.get()) return nullptr; in CreateRsaOperation()
80 padding, rsa.release()); in CreateRsaOperation()
331 UniquePtr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(rsa_key_))); in SignUndigested() local
332 if (!rsa.get()) return TranslateLastOpenSslError(); in SignUndigested()
334 if (!output->Reinitialize(RSA_size(rsa.get()))) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in SignUndigested()
349 bytes_encrypted = RSA_private_encrypt(key_len, to_encrypt, output->peek_write(), rsa.get(), in SignUndigested()
361 output->peek_write(), rsa.get(), RSA_PKCS1_PADDING); in SignUndigested()
428 UniquePtr<RSA, RSA_Delete> rsa(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(rsa_key_))); in VerifyUndigested() local
429 if (!rsa.get()) return KM_ERROR_UNKNOWN_ERROR; in VerifyUndigested()
[all …]
/system/update_engine/payload_consumer/
Dpayload_verifier.cc204 RSA* rsa = EVP_PKEY_get0_RSA(const_cast<EVP_PKEY*>(public_key)); in GetRawHashFromSignature() local
206 TEST_AND_RETURN_FALSE(rsa != nullptr); in GetRawHashFromSignature()
207 unsigned int keysize = RSA_size(rsa); in GetRawHashFromSignature()
216 sig_data.size(), sig_data.data(), hash_data.data(), rsa, RSA_NO_PADDING); in GetRawHashFromSignature()
Ddelta_performer_integration_test.cc360 RSA* rsa = RSA_new(); in SignGeneratedShellPayload() local
363 EXPECT_EQ(1, RSA_generate_key_ex(rsa, 2048, e, nullptr)); in SignGeneratedShellPayload()
369 fprikey, rsa, nullptr, nullptr, 0, nullptr, nullptr)); in SignGeneratedShellPayload()
371 RSA_free(rsa); in SignGeneratedShellPayload()
/system/security/ondevice-signing/
DCertUtils.cpp170 RSA* rsa = EVP_PKEY_get1_RSA(pkey); in extractPublicKey() local
171 auto num_bytes = BN_num_bytes(rsa->n); in extractPublicKey()
173 int res = BN_bn2bin(rsa->n, pubKey.data()); in extractPublicKey()
174 RSA_free(rsa); in extractPublicKey()
/system/update_engine/payload_generator/
Dpayload_signer.cc310 RSA* rsa = EVP_PKEY_get0_RSA(private_key.get()); in SignHash() local
311 TEST_AND_RETURN_FALSE(rsa != nullptr); in SignHash()
314 PayloadVerifier::PadRSASHA256Hash(&padded_hash, RSA_size(rsa)); in SignHash()
316 signature.resize(RSA_size(rsa)); in SignHash()
320 rsa, in SignHash()
/system/keymaster/key_blob_utils/
Dsoftware_keyblobs.cpp119 RSA_Ptr rsa(EVP_PKEY_get1_RSA(pubkey)); in FakeKeyAuthorizations() local
120 if (!rsa) return TranslateLastOpenSslError(); in FakeKeyAuthorizations()
121 hw_enforced->push_back(TAG_KEY_SIZE, RSA_size(rsa.get()) * 8); in FakeKeyAuthorizations()
122 uint64_t public_exponent = BN_get_word(rsa->e); in FakeKeyAuthorizations()
/system/apex/tools/
Dcreate_apex_skeleton.sh63 openssl req -x509 -config csr.conf -newkey rsa:4096 -nodes -days 999999 -keyout key.pem -out ${APEX…
/system/update_engine/
DAndroid.bp690 …cmd: "openssl rsa -in $(location unittest_key.pem) -pubout -out $(location unittest_key.pub.pem) &…
691 …"openssl rsa -in $(location unittest_key2.pem) -pubout -out $(location unittest_key2.pub.pem) &&" +
692 …"openssl rsa -in $(location unittest_key_RSA4096.pem) -pubout -out $(location unittest_key_RSA4096…
/system/apex/shim/build/
DAndroid.bp371 …cmd: "openssl req -x509 -newkey rsa:4096 -nodes -days 999999 -subj '/DN=/EMAILADDRESS=android@andr…
387 …cmd: "openssl req -x509 -key $(in) -newkey rsa:4096 -nodes -days 999999 -subj '/DN=/EMAILADDRESS=a…
/system/apex/docs/
Dhowto.md222 # create an rsa key pair
276 $ openssl req -x509 -newkey rsa:4096 -nodes -days 999999 -keyout key.pem -out com.android.my.apex.x…
DREADME.md368 Create an rsa key pair.