• Home
  • Raw
  • Download

Lines Matching refs:pkey

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
338 if (EVP_PKEY_assign_EC_KEY(pkey, eckey.get()) == 0) { in generate_ec_keypair()
347 static int generate_rsa_keypair(EVP_PKEY* pkey, const keymaster_rsa_keygen_params_t* rsa_params) { in generate_rsa_keypair() argument
372 if (EVP_PKEY_assign_RSA(pkey, rsa.get()) == 0) { in generate_rsa_keypair()
384 Unique_EVP_PKEY pkey(EVP_PKEY_new()); in openssl_generate_keypair() local
385 if (pkey.get() == NULL) { in openssl_generate_keypair()
396 generate_dsa_keypair(pkey.get(), dsa_params); in openssl_generate_keypair()
400 generate_ec_keypair(pkey.get(), ec_params); in openssl_generate_keypair()
404 generate_rsa_keypair(pkey.get(), rsa_params); in openssl_generate_keypair()
410 if (wrap_key(pkey.get(), EVP_PKEY_type(pkey->type), keyBlob, keyBlobLength)) { in openssl_generate_keypair()
437 Unique_EVP_PKEY pkey(EVP_PKCS82PKEY(pkcs8.get())); in openssl_import_keypair() local
438 if (pkey.get() == NULL) { in openssl_import_keypair()
444 if (wrap_key(pkey.get(), EVP_PKEY_type(pkey->type), key_blob, key_blob_length)) { in openssl_import_keypair()
460 Unique_EVP_PKEY pkey(unwrap_key(key_blob, key_blob_length)); in openssl_get_keypair_public() local
461 if (pkey.get() == NULL) { in openssl_get_keypair_public()
465 int len = i2d_PUBKEY(pkey.get(), NULL); in openssl_get_keypair_public()
478 if (i2d_PUBKEY(pkey.get(), &tmp) != len) { in openssl_get_keypair_public()
490 static int sign_dsa(EVP_PKEY* pkey, keymaster_dsa_sign_params_t* sign_params, const uint8_t* data, in sign_dsa() argument
497 Unique_DSA dsa(EVP_PKEY_get1_DSA(pkey)); in sign_dsa()
522 static int sign_ec(EVP_PKEY* pkey, keymaster_ec_sign_params_t* sign_params, const uint8_t* data, in sign_ec() argument
529 Unique_EC_KEY eckey(EVP_PKEY_get1_EC_KEY(pkey)); in sign_ec()
554 static int sign_rsa(EVP_PKEY* pkey, keymaster_rsa_sign_params_t* sign_params, const uint8_t* data, in sign_rsa() argument
564 Unique_RSA rsa(EVP_PKEY_get1_RSA(pkey)); in sign_rsa()
600 Unique_EVP_PKEY pkey(unwrap_key(keyBlob, keyBlobLength)); in openssl_sign_data() local
601 if (pkey.get() == NULL) { in openssl_sign_data()
605 int type = EVP_PKEY_type(pkey->type); in openssl_sign_data()
609 return sign_dsa(pkey.get(), const_cast<keymaster_dsa_sign_params_t*>(sign_params), data, in openssl_sign_data()
614 return sign_ec(pkey.get(), const_cast<keymaster_ec_sign_params_t*>(sign_params), data, in openssl_sign_data()
619 return sign_rsa(pkey.get(), const_cast<keymaster_rsa_sign_params_t*>(sign_params), data, in openssl_sign_data()
627 static int verify_dsa(EVP_PKEY* pkey, keymaster_dsa_sign_params_t* sign_params, in verify_dsa() argument
635 Unique_DSA dsa(EVP_PKEY_get1_DSA(pkey)); in verify_dsa()
649 static int verify_ec(EVP_PKEY* pkey, keymaster_ec_sign_params_t* sign_params, in verify_ec() argument
657 Unique_EC_KEY eckey(EVP_PKEY_get1_EC_KEY(pkey)); in verify_ec()
672 static int verify_rsa(EVP_PKEY* pkey, keymaster_rsa_sign_params_t* sign_params, in verify_rsa() argument
686 Unique_RSA rsa(EVP_PKEY_get1_RSA(pkey)); in verify_rsa()
722 Unique_EVP_PKEY pkey(unwrap_key(keyBlob, keyBlobLength)); in openssl_verify_data() local
723 if (pkey.get() == NULL) { in openssl_verify_data()
727 int type = EVP_PKEY_type(pkey->type); in openssl_verify_data()
731 return verify_dsa(pkey.get(), const_cast<keymaster_dsa_sign_params_t*>(sign_params), in openssl_verify_data()
736 return verify_rsa(pkey.get(), const_cast<keymaster_rsa_sign_params_t*>(sign_params), in openssl_verify_data()
741 return verify_ec(pkey.get(), const_cast<keymaster_ec_sign_params_t*>(sign_params), in openssl_verify_data()