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

12

/system/keymaster/
H A Dec_key.cpp27 bool EcKey::EvpToInternal(const EVP_PKEY* pkey) { argument
28 ec_key_.reset(EVP_PKEY_get1_EC_KEY(const_cast<EVP_PKEY*>(pkey)));
32 bool EcKey::InternalToEvp(EVP_PKEY* pkey) const {
33 return EVP_PKEY_set1_EC_KEY(pkey, ec_key_.get()) == 1;
H A Dopenssl_utils.cpp38 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) {
47 pkey->reset(EVP_PKCS82PKEY(pkcs8.get()));
48 if (!pkey->get())
51 if (EVP_PKEY_type((*pkey)->type) != convert_to_evp(expected_algorithm)) {
52 LOG_E("EVP key algorithm was %d, not the expected %d", EVP_PKEY_type((*pkey)->type),
63 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) {
68 expected_algorithm, pkey);
71 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { argument
72 int key_data_size = i2d_PrivateKey(pkey, NULL /* key_data*/);
80 i2d_PrivateKey(pkey,
36 convert_pkcs8_blob_to_evp(const uint8_t* key_data, size_t key_length, keymaster_algorithm_t expected_algorithm, UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) argument
60 KeyMaterialToEvpKey(keymaster_key_format_t key_format, const KeymasterKeyBlob& key_material, keymaster_algorithm_t expected_algorithm, UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey) argument
[all...]
H A Dasymmetric_key.cpp37 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new());
38 if (!InternalToEvp(pkey.get()))
41 int key_data_length = i2d_PUBKEY(pkey.get(), NULL);
50 if (i2d_PUBKEY(pkey.get(), &tmp) != key_data_length) {
H A Drsa_key.cpp27 bool RsaKey::EvpToInternal(const EVP_PKEY* pkey) { argument
28 rsa_key_.reset(EVP_PKEY_get1_RSA(const_cast<EVP_PKEY*>(pkey)));
32 bool RsaKey::InternalToEvp(EVP_PKEY* pkey) const {
33 return EVP_PKEY_set1_RSA(pkey, rsa_key_.get()) == 1;
H A Dasymmetric_key.h36 virtual bool InternalToEvp(EVP_PKEY* pkey) const = 0;
37 virtual bool EvpToInternal(const EVP_PKEY* pkey) = 0;
H A Dasymmetric_key_factory.cpp52 EVP_PKEY* pkey = local
53 d2i_PrivateKey(evp_key_type(), NULL /* pkey */, &tmp, key_material.key_material_size);
54 if (!pkey)
56 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey_deleter(pkey);
58 if (!asymmetric_key->EvpToInternal(pkey))
H A Dec_key.h35 bool InternalToEvp(EVP_PKEY* pkey) const override;
36 bool EvpToInternal(const EVP_PKEY* pkey) override;
H A Drsa_key.h32 bool InternalToEvp(EVP_PKEY* pkey) const override;
33 bool EvpToInternal(const EVP_PKEY* pkey) override;
H A Dec_key_factory.cpp59 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new());
60 if (ec_key.get() == NULL || pkey.get() == NULL)
79 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get()) != 1)
83 keymaster_error_t error = EvpKeyToKeyMaterial(pkey.get(), &key_material);
119 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey;
121 KeyMaterialToEvpKey(key_format, key_material, keymaster_key_type(), &pkey);
125 UniquePtr<EC_KEY, EC_Delete> ec_key(EVP_PKEY_get1_EC_KEY(pkey.get()));
H A Drsa_key_factory.cpp79 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new());
80 if (exponent.get() == NULL || rsa_key.get() == NULL || pkey.get() == NULL)
87 if (EVP_PKEY_set1_RSA(pkey.get(), rsa_key.get()) != 1)
91 keymaster_error_t error = EvpKeyToKeyMaterial(pkey.get(), &key_material);
129 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey;
131 KeyMaterialToEvpKey(key_format, key_material, keymaster_key_type(), &pkey);
135 UniquePtr<RSA, RsaKey::RSA_Delete> rsa_key(EVP_PKEY_get1_RSA(pkey.get()));
H A Decdsa_keymaster1_operation.cpp91 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new());
92 if (!key.InternalToEvp(pkey.get())) {
96 return pkey.release();
H A Drsa_keymaster1_operation.cpp107 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new());
108 if (!key.InternalToEvp(pkey.get())) {
112 return pkey.release();
H A Dopenssl_utils.h79 UniquePtr<EVP_PKEY, EVP_PKEY_Delete>* pkey);
H A Dkeymaster0_engine.cpp178 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob));
179 if (!pkey)
181 unique_ptr<RSA, RSA_Delete> public_rsa(EVP_PKEY_get1_RSA(pkey.get()));
203 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob));
204 if (!pkey)
207 unique_ptr<EC_KEY, EC_Delete> public_ec_key(EVP_PKEY_get1_EC_KEY(pkey.get()));
H A Dkeymaster1_engine.cpp142 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(
144 if (!pkey) {
149 unique_ptr<RSA, RSA_Delete> public_rsa(EVP_PKEY_get1_RSA(pkey.get()));
184 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(
186 if (!pkey) {
191 unique_ptr<EC_KEY, EC_Delete> public_ec_key(EVP_PKEY_get1_EC_KEY(pkey.get()));
H A Decdsa_operation.cpp40 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new());
41 if (!ecdsa_key->InternalToEvp(pkey.get())) {
51 Operation* op = InstantiateOperation(digest, pkey.release());
/system/extras/verity/
H A Dgenerate_verity_key.c40 static int convert_to_mincrypt_format(RSA *rsa, RSAPublicKey *pkey) argument
63 pkey->len = RSANUMWORDS;
64 pkey->n0inv = 0 - BN_get_word(n0inv);
67 pkey->rr[i] = BN_get_word(rem);
69 pkey->n[i] = BN_get_word(rem);
71 pkey->exponent = BN_get_word(rsa->e);
89 RSAPublicKey pkey; local
97 if (convert_to_mincrypt_format(private_key, &pkey) < 0)
104 BIO_write(bfile, &pkey, sizeof(pkey));
118 EVP_PKEY *pkey = NULL; local
180 EVP_PKEY* pkey = EVP_PKEY_new(); local
[all...]
H A Dverify_boot_signature.c324 EVP_PKEY *pkey = NULL; local
336 if ((pkey = X509_get_pubkey(bs->certificate)) == NULL) {
341 if ((rsa = EVP_PKEY_get1_RSA(pkey)) == NULL) {
355 if (pkey) {
356 EVP_PKEY_free(pkey);
/system/security/softkeymaster/
H A Dkeymaster_openssl.cpp109 static int wrap_key(EVP_PKEY* pkey, int type, uint8_t** keyBlob, size_t* keyBlobLength) { argument
115 int privateLen = i2d_PrivateKey(pkey, NULL);
152 if (i2d_PrivateKey(pkey, &p) != privateLen) {
211 Unique_EVP_PKEY pkey(EVP_PKEY_new());
212 if (pkey.get() == NULL) {
216 EVP_PKEY* tmp = pkey.get();
223 return pkey.release();
226 static int generate_dsa_keypair(EVP_PKEY* pkey, const keymaster_dsa_keygen_params_t* dsa_params) { argument
267 if (EVP_PKEY_assign_DSA(pkey, dsa.get()) == 0) {
276 static int generate_ec_keypair(EVP_PKEY* pkey, cons argument
331 generate_rsa_keypair(EVP_PKEY* pkey, const keymaster_rsa_keygen_params_t* rsa_params) argument
474 sign_dsa(EVP_PKEY* pkey, keymaster_dsa_sign_params_t* sign_params, const uint8_t* data, const size_t dataLength, uint8_t** signedData, size_t* signedDataLength) argument
506 sign_ec(EVP_PKEY* pkey, keymaster_ec_sign_params_t* sign_params, const uint8_t* data, const size_t dataLength, uint8_t** signedData, size_t* signedDataLength) argument
538 sign_rsa(EVP_PKEY* pkey, keymaster_rsa_sign_params_t* sign_params, const uint8_t* data, const size_t dataLength, uint8_t** signedData, size_t* signedDataLength) argument
611 verify_dsa(EVP_PKEY* pkey, keymaster_dsa_sign_params_t* sign_params, const uint8_t* signedData, const size_t signedDataLength, const uint8_t* signature, const size_t signatureLength) argument
633 verify_ec(EVP_PKEY* pkey, keymaster_ec_sign_params_t* sign_params, const uint8_t* signedData, const size_t signedDataLength, const uint8_t* signature, const size_t signatureLength) argument
656 verify_rsa(EVP_PKEY* pkey, keymaster_rsa_sign_params_t* sign_params, const uint8_t* signedData, const size_t signedDataLength, const uint8_t* signature, const size_t signatureLength) argument
[all...]
/system/core/adb/
H A Dadb_auth_host.cpp71 static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey) argument
96 pkey->len = RSANUMWORDS;
97 pkey->n0inv = 0 - BN_get_word(n0inv);
100 pkey->rr[i] = BN_get_word(rem);
102 pkey->n[i] = BN_get_word(rem);
104 pkey->exponent = BN_get_word(rsa->e);
158 RSAPublicKey pkey; local
171 if (!RSA_to_RSAPublicKey(private_key, &pkey)) {
185 if (!EVP_EncodedLength(&encoded_length, sizeof(pkey))) {
192 encoded_length = 1 + ((sizeof(pkey)
222 EVP_PKEY* pkey = EVP_PKEY_new(); local
[all...]
/system/security/keystore-engine/
H A Deng_keystore.cpp133 Unique_EVP_PKEY pkey(d2i_PUBKEY(NULL, &tmp, pubkeyLen));
135 if (pkey.get() == NULL) {
140 switch (EVP_PKEY_type(pkey->type)) {
142 dsa_pkey_setup(e, pkey.get(), key_id);
146 rsa_pkey_setup(e, pkey.get(), key_id);
150 ecdsa_pkey_setup(e, pkey.get(), key_id);
154 ALOGE("Unsupported key type %d", EVP_PKEY_type(pkey->type));
158 return pkey.release();
H A Dandroid_engine.cpp424 Unique_EVP_PKEY pkey(d2i_PUBKEY(NULL, &inp, pubkey_len));
426 if (pkey.get() == NULL) {
434 switch (EVP_PKEY_type(pkey->type)) {
436 Unique_RSA public_rsa(EVP_PKEY_get1_RSA(pkey.get()));
441 Unique_EC_KEY public_ecdsa(EVP_PKEY_get1_EC_KEY(pkey.get()));
446 ALOGE("Unsupported key type %d", EVP_PKEY_type(pkey->type));
H A Ddsa_meth.cpp124 int dsa_pkey_setup(ENGINE *e, EVP_PKEY *pkey, const char *key_id) { argument
125 Unique_DSA dsa(EVP_PKEY_get1_DSA(pkey));
H A Decdsa_meth.cpp124 int ecdsa_pkey_setup(ENGINE *e, EVP_PKEY *pkey, const char *key_id) { argument
125 Unique_EC_KEY eckey(EVP_PKEY_get1_EC_KEY(pkey));
H A Drsa_meth.cpp212 int rsa_pkey_setup(ENGINE *e, EVP_PKEY *pkey, const char *key_id) { argument
213 Unique_RSA rsa(EVP_PKEY_get1_RSA(pkey));

Completed in 820 milliseconds

12