/system/extras/verity/ |
D | generate_verity_key.c | 37 static int convert_to_mincrypt_format(RSA *rsa, RSAPublicKey *pkey) in convert_to_mincrypt_format() argument 60 pkey->len = RSANUMWORDS; in convert_to_mincrypt_format() 61 pkey->n0inv = 0 - BN_get_word(n0inv); in convert_to_mincrypt_format() 64 pkey->rr[i] = BN_get_word(rem); in convert_to_mincrypt_format() 66 pkey->n[i] = BN_get_word(rem); in convert_to_mincrypt_format() 68 pkey->exponent = BN_get_word(rsa->e); in convert_to_mincrypt_format() 86 RSAPublicKey pkey; in write_public_keyfile() local 94 if (convert_to_mincrypt_format(private_key, &pkey) < 0) in write_public_keyfile() 101 BIO_write(bfile, &pkey, sizeof(pkey)); in write_public_keyfile() 115 EVP_PKEY *pkey = NULL; in convert_x509() local [all …]
|
D | verify_boot_signature.c | 313 EVP_PKEY *pkey = NULL; in verify_signature() local 325 if ((pkey = X509_get_pubkey(bs->certificate)) == NULL) { in verify_signature() 330 if ((rsa = EVP_PKEY_get1_RSA(pkey)) == NULL) { in verify_signature() 344 if (pkey) { in verify_signature() 345 EVP_PKEY_free(pkey); in verify_signature()
|
/system/security/softkeymaster/ |
D | keymaster_openssl.cpp | 124 static int wrap_key(EVP_PKEY* pkey, int type, uint8_t** keyBlob, size_t* keyBlobLength) { in wrap_key() argument 130 int privateLen = i2d_PrivateKey(pkey, NULL); in wrap_key() 167 if (i2d_PrivateKey(pkey, &p) != privateLen) { in wrap_key() 226 Unique_EVP_PKEY pkey(EVP_PKEY_new()); in unwrap_key() local 227 if (pkey.get() == NULL) { in unwrap_key() 231 EVP_PKEY* tmp = pkey.get(); in unwrap_key() 238 return pkey.release(); in unwrap_key() 241 static int generate_dsa_keypair(EVP_PKEY* pkey, const keymaster_dsa_keygen_params_t* dsa_params) { in generate_dsa_keypair() argument 282 if (EVP_PKEY_assign_DSA(pkey, dsa.get()) == 0) { in generate_dsa_keypair() 291 static int generate_ec_keypair(EVP_PKEY* pkey, const keymaster_ec_keygen_params_t* ec_params) { in generate_ec_keypair() argument [all …]
|
/system/keymaster/ |
D | asymmetric_key.cpp | 59 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in key_material() local 60 if (pkey.get() == NULL) in key_material() 63 if (!InternalToEvp(pkey.get())) in key_material() 66 *size = i2d_PrivateKey(pkey.get(), NULL /* key_data*/); in key_material() 72 i2d_PrivateKey(pkey.get(), &tmp); in key_material() 86 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in formatted_key_material() local 87 if (!InternalToEvp(pkey.get())) in formatted_key_material() 90 int key_data_length = i2d_PUBKEY(pkey.get(), NULL); in formatted_key_material() 99 if (i2d_PUBKEY(pkey.get(), &tmp) != key_data_length) { in formatted_key_material() 142 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKEY_new()); in GenerateKey() local [all …]
|
D | asymmetric_key.h | 54 virtual bool InternalToEvp(EVP_PKEY* pkey) const = 0; 55 virtual bool EvpToInternal(const EVP_PKEY* pkey) = 0; 64 static RsaKey* ImportKey(const AuthorizationSet& key_description, EVP_PKEY* pkey, 76 virtual bool InternalToEvp(EVP_PKEY* pkey) const; 77 virtual bool EvpToInternal(const EVP_PKEY* pkey); 90 static DsaKey* ImportKey(const AuthorizationSet& key_description, EVP_PKEY* pkey, 104 virtual bool InternalToEvp(EVP_PKEY* pkey) const; 105 virtual bool EvpToInternal(const EVP_PKEY* pkey); 118 static EcdsaKey* ImportKey(const AuthorizationSet& key_description, EVP_PKEY* pkey, 133 virtual bool InternalToEvp(EVP_PKEY* pkey) const; [all …]
|
D | key.cpp | 97 UniquePtr<EVP_PKEY, EVP_PKEY_Delete> pkey(EVP_PKCS82PKEY(pkcs8.get())); in ImportKey() local 98 if (pkey.get() == NULL) { in ImportKey() 104 switch (EVP_PKEY_type(pkey->type)) { in ImportKey() 106 return RsaKey::ImportKey(key_description, pkey.get(), logger, error); in ImportKey() 108 return DsaKey::ImportKey(key_description, pkey.get(), logger, error); in ImportKey() 110 return EcdsaKey::ImportKey(key_description, pkey.get(), logger, error); in ImportKey()
|
/system/security/keystore-engine/ |
D | eng_keystore.cpp | 133 Unique_EVP_PKEY pkey(d2i_PUBKEY(NULL, &tmp, pubkeyLen)); in keystore_loadkey() local 135 if (pkey.get() == NULL) { in keystore_loadkey() 140 switch (EVP_PKEY_type(pkey->type)) { in keystore_loadkey() 142 dsa_pkey_setup(e, pkey.get(), key_id); in keystore_loadkey() 146 rsa_pkey_setup(e, pkey.get(), key_id); in keystore_loadkey() 150 ecdsa_pkey_setup(e, pkey.get(), key_id); in keystore_loadkey() 154 ALOGE("Unsupported key type %d", EVP_PKEY_type(pkey->type)); in keystore_loadkey() 158 return pkey.release(); in keystore_loadkey()
|
D | dsa_meth.cpp | 124 int dsa_pkey_setup(ENGINE *e, EVP_PKEY *pkey, const char *key_id) { in dsa_pkey_setup() argument 125 Unique_DSA dsa(EVP_PKEY_get1_DSA(pkey)); in dsa_pkey_setup()
|
D | ecdsa_meth.cpp | 124 int ecdsa_pkey_setup(ENGINE *e, EVP_PKEY *pkey, const char *key_id) { in ecdsa_pkey_setup() argument 125 Unique_EC_KEY eckey(EVP_PKEY_get1_EC_KEY(pkey)); in ecdsa_pkey_setup()
|
D | rsa_meth.cpp | 212 int rsa_pkey_setup(ENGINE *e, EVP_PKEY *pkey, const char *key_id) { in rsa_pkey_setup() argument 213 Unique_RSA rsa(EVP_PKEY_get1_RSA(pkey)); in rsa_pkey_setup()
|
/system/core/adb/ |
D | adb_auth_host.c | 66 static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey) in RSA_to_RSAPublicKey() argument 91 pkey->len = RSANUMWORDS; in RSA_to_RSAPublicKey() 92 pkey->n0inv = 0 - BN_get_word(n0inv); in RSA_to_RSAPublicKey() 95 pkey->rr[i] = BN_get_word(rem); in RSA_to_RSAPublicKey() 97 pkey->n[i] = BN_get_word(rem); in RSA_to_RSAPublicKey() 99 pkey->exponent = BN_get_word(rsa->e); in RSA_to_RSAPublicKey() 153 RSAPublicKey pkey; in write_public_keyfile() local 162 ret = RSA_to_RSAPublicKey(private_key, &pkey); in write_public_keyfile() 180 BIO_write(bio, &pkey, sizeof(pkey)); in write_public_keyfile() 195 EVP_PKEY* pkey = EVP_PKEY_new(); in generate_key() local [all …]
|
/system/security/keystore/ |
D | keystore.cpp | 1454 Unique_EVP_PKEY pkey(PEM_read_bio_PrivateKey(b.get(), NULL, NULL, NULL)); in importBlobAsKey() local 1455 if (pkey.get() == NULL) { in importBlobAsKey() 1460 Unique_PKCS8_PRIV_KEY_INFO pkcs8(EVP_PKEY2PKCS8(pkey.get())); in importBlobAsKey()
|