Lines Matching refs:pkey
35 EVP_PKEY *pkey; member
93 EVP_PKEY_free(pubkey->pkey); in x509_pubkey_ex_free()
163 EVP_PKEY_free(pubkey->pkey); in x509_pubkey_ex_d2i_ex()
164 pubkey->pkey = NULL; in x509_pubkey_ex_d2i_ex()
177 if ((ret = x509_pubkey_decode(&pubkey->pkey, pubkey)) == -1) { in x509_pubkey_ex_d2i_ex()
208 OSSL_DECODER_CTX_new_for_pkey(&pubkey->pkey, in x509_pubkey_ex_d2i_ex()
306 if (a->pkey != NULL) { in X509_PUBKEY_dup()
308 pubkey->pkey = EVP_PKEY_dup(a->pkey); in X509_PUBKEY_dup()
309 if (pubkey->pkey == NULL) { in X509_PUBKEY_dup()
311 if (x509_pubkey_decode(&pubkey->pkey, pubkey) <= 0) { in X509_PUBKEY_dup()
323 int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) in X509_PUBKEY_set() argument
327 if (x == NULL || pkey == NULL) { in X509_PUBKEY_set()
332 if (pkey->ameth != NULL) { in X509_PUBKEY_set()
337 if (pkey->ameth->pub_encode != NULL) { in X509_PUBKEY_set()
338 if (!pkey->ameth->pub_encode(pk, pkey)) { in X509_PUBKEY_set()
346 } else if (evp_pkey_is_provided(pkey)) { in X509_PUBKEY_set()
350 OSSL_ENCODER_CTX_new_for_pkey(pkey, EVP_PKEY_PUBLIC_KEY, in X509_PUBKEY_set()
370 if (!EVP_PKEY_up_ref(pkey)) { in X509_PUBKEY_set()
386 if (pk->pkey != NULL) in X509_PUBKEY_set()
387 EVP_PKEY_free(pk->pkey); in X509_PUBKEY_set()
389 pk->pkey = pkey; in X509_PUBKEY_set()
406 EVP_PKEY *pkey; in x509_pubkey_decode() local
423 pkey = EVP_PKEY_new(); in x509_pubkey_decode()
424 if (pkey == NULL) { in x509_pubkey_decode()
429 if (!EVP_PKEY_set_type(pkey, nid)) { in x509_pubkey_decode()
434 if (pkey->ameth->pub_decode) { in x509_pubkey_decode()
440 if (!pkey->ameth->pub_decode(pkey, key)) in x509_pubkey_decode()
447 *ppkey = pkey; in x509_pubkey_decode()
451 EVP_PKEY_free(pkey); in x509_pubkey_decode()
462 if (key->pkey == NULL) { in X509_PUBKEY_get0()
468 return key->pkey; in X509_PUBKEY_get0()
565 xpk->pkey = (EVP_PKEY *)a; in i2d_PUBKEY()
567 xpk->pkey = NULL; in i2d_PUBKEY()
607 EVP_PKEY *pkey; in d2i_RSA_PUBKEY() local
612 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in d2i_RSA_PUBKEY()
613 if (pkey == NULL) in d2i_RSA_PUBKEY()
615 key = EVP_PKEY_get1_RSA(pkey); in d2i_RSA_PUBKEY()
616 EVP_PKEY_free(pkey); in d2i_RSA_PUBKEY()
640 pktmp->pkey.ptr = NULL; in i2d_RSA_PUBKEY()
648 EVP_PKEY *pkey; in ossl_d2i_DH_PUBKEY() local
653 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in ossl_d2i_DH_PUBKEY()
654 if (pkey == NULL) in ossl_d2i_DH_PUBKEY()
656 if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DH) in ossl_d2i_DH_PUBKEY()
657 key = EVP_PKEY_get1_DH(pkey); in ossl_d2i_DH_PUBKEY()
658 EVP_PKEY_free(pkey); in ossl_d2i_DH_PUBKEY()
682 pktmp->pkey.ptr = NULL; in ossl_i2d_DH_PUBKEY()
689 EVP_PKEY *pkey; in ossl_d2i_DHx_PUBKEY() local
694 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in ossl_d2i_DHx_PUBKEY()
695 if (pkey == NULL) in ossl_d2i_DHx_PUBKEY()
697 if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DHX) in ossl_d2i_DHx_PUBKEY()
698 key = EVP_PKEY_get1_DH(pkey); in ossl_d2i_DHx_PUBKEY()
699 EVP_PKEY_free(pkey); in ossl_d2i_DHx_PUBKEY()
723 pktmp->pkey.ptr = NULL; in ossl_i2d_DHx_PUBKEY()
732 EVP_PKEY *pkey; in d2i_DSA_PUBKEY() local
737 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in d2i_DSA_PUBKEY()
738 if (pkey == NULL) in d2i_DSA_PUBKEY()
740 key = EVP_PKEY_get1_DSA(pkey); in d2i_DSA_PUBKEY()
741 EVP_PKEY_free(pkey); in d2i_DSA_PUBKEY()
789 pktmp->pkey.ptr = NULL; in i2d_DSA_PUBKEY()
798 EVP_PKEY *pkey; in d2i_EC_PUBKEY() local
804 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in d2i_EC_PUBKEY()
805 if (pkey == NULL) in d2i_EC_PUBKEY()
807 type = EVP_PKEY_get_id(pkey); in d2i_EC_PUBKEY()
809 key = EVP_PKEY_get1_EC_KEY(pkey); in d2i_EC_PUBKEY()
810 EVP_PKEY_free(pkey); in d2i_EC_PUBKEY()
834 pktmp->pkey.ptr = NULL; in i2d_EC_PUBKEY()
843 EVP_PKEY *pkey; in ossl_d2i_ED25519_PUBKEY() local
848 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in ossl_d2i_ED25519_PUBKEY()
849 if (pkey == NULL) in ossl_d2i_ED25519_PUBKEY()
851 key = ossl_evp_pkey_get1_ED25519(pkey); in ossl_d2i_ED25519_PUBKEY()
852 EVP_PKEY_free(pkey); in ossl_d2i_ED25519_PUBKEY()
876 pktmp->pkey.ptr = NULL; in ossl_i2d_ED25519_PUBKEY()
884 EVP_PKEY *pkey; in ossl_d2i_ED448_PUBKEY() local
889 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in ossl_d2i_ED448_PUBKEY()
890 if (pkey == NULL) in ossl_d2i_ED448_PUBKEY()
892 if (EVP_PKEY_get_id(pkey) == EVP_PKEY_ED448) in ossl_d2i_ED448_PUBKEY()
893 key = ossl_evp_pkey_get1_ED448(pkey); in ossl_d2i_ED448_PUBKEY()
894 EVP_PKEY_free(pkey); in ossl_d2i_ED448_PUBKEY()
918 pktmp->pkey.ptr = NULL; in ossl_i2d_ED448_PUBKEY()
926 EVP_PKEY *pkey; in ossl_d2i_X25519_PUBKEY() local
931 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in ossl_d2i_X25519_PUBKEY()
932 if (pkey == NULL) in ossl_d2i_X25519_PUBKEY()
934 if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X25519) in ossl_d2i_X25519_PUBKEY()
935 key = ossl_evp_pkey_get1_X25519(pkey); in ossl_d2i_X25519_PUBKEY()
936 EVP_PKEY_free(pkey); in ossl_d2i_X25519_PUBKEY()
960 pktmp->pkey.ptr = NULL; in ossl_i2d_X25519_PUBKEY()
968 EVP_PKEY *pkey; in ossl_d2i_X448_PUBKEY() local
973 pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length); in ossl_d2i_X448_PUBKEY()
974 if (pkey == NULL) in ossl_d2i_X448_PUBKEY()
976 if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X448) in ossl_d2i_X448_PUBKEY()
977 key = ossl_evp_pkey_get1_X448(pkey); in ossl_d2i_X448_PUBKEY()
978 EVP_PKEY_free(pkey); in ossl_d2i_X448_PUBKEY()
1002 pktmp->pkey.ptr = NULL; in ossl_i2d_X448_PUBKEY()