/openssl/crypto/evp/ |
H A D | keymgmt_lib.c | 92 return evp_keymgmt_export(pk->keymgmt, pk->keydata, selection, in evp_keymgmt_util_export() 107 if (pk->keydata == NULL) in evp_keymgmt_util_export_to_provider() 117 if (pk->keymgmt == keymgmt in evp_keymgmt_util_export_to_provider() 120 return pk->keydata; in evp_keymgmt_util_export_to_provider() 129 if (pk->dirty_cnt == pk->dirty_cnt_copy) { in evp_keymgmt_util_export_to_provider() 196 if (pk->dirty_cnt != pk->dirty_cnt_copy) in evp_keymgmt_util_export_to_provider() 208 pk->dirty_cnt_copy = pk->dirty_cnt; in evp_keymgmt_util_export_to_provider() 224 if (pk != NULL) { in evp_keymgmt_util_clear_operation_cache() 307 if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) { in evp_keymgmt_util_cache_keyinfo() 332 if (pk->keymgmt == NULL) in evp_keymgmt_util_has() [all …]
|
H A D | p_lib.c | 1853 if (pk == NULL) in evp_pkey_export_to_provider() 1866 if (pk->pkey.ptr != NULL) { in evp_pkey_export_to_provider() 1871 if (pk->ameth->dirty_cnt == NULL || pk->ameth->export_to == NULL) in evp_pkey_export_to_provider() 1900 if (pk->pkey.ptr != NULL) { in evp_pkey_export_to_provider() 1908 if (pk->ameth->dirty_cnt(pk) == pk->dirty_cnt_copy) { in evp_pkey_export_to_provider() 1943 if (!pk->ameth->export_to(pk, keydata, tmp_keymgmt->import, in evp_pkey_export_to_provider() 1964 if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy in evp_pkey_export_to_provider() 1995 pk->dirty_cnt_copy = pk->ameth->dirty_cnt(pk); in evp_pkey_export_to_provider() 2118 if (!ossl_assert(pk != NULL)) in evp_pkey_get_legacy() 2125 if (!evp_pkey_is_assigned(pk)) in evp_pkey_get_legacy() [all …]
|
/openssl/test/ |
H A D | evp_pkey_provided_test.c | 427 pk = dup_pk; in test_fromdata_rsa() 442 EVP_PKEY_free(pk); in test_fromdata_rsa() 529 pk = dup_pk; in do_fromdata_rsa_derive() 534 EVP_PKEY_free(pk); in do_fromdata_rsa_derive() 889 EVP_PKEY_free(pk); in test_evp_pkey_get_bn_param_large() 1090 pk = dup_pk; in test_fromdata_dh_named_group() 1104 EVP_PKEY_free(pk); in test_fromdata_dh_named_group() 1268 pk = dup_pk; in test_fromdata_dh_fips186_4() 1560 pk = dup_pk; in test_fromdata_ecx() 1757 pk = dup_pk; in test_fromdata_ec() [all …]
|
H A D | keymgmt_internal_test.c | 148 EVP_PKEY *pk = NULL, *dup_pk = NULL; in test_pass_rsa() local 216 if (!TEST_ptr(pk = EVP_PKEY_new()) in test_pass_rsa() 217 || !TEST_true(EVP_PKEY_assign_RSA(pk, rsa))) in test_pass_rsa() 231 if (!TEST_ptr_null(provkey2 = evp_pkey_export_to_provider(pk, NULL, in test_pass_rsa() 236 if (!TEST_ptr(provkey = evp_pkey_export_to_provider(pk, NULL, &km1, in test_pass_rsa() 262 if (!TEST_ptr(dup_pk = EVP_PKEY_dup(pk))) in test_pass_rsa() 265 ret = TEST_int_eq(EVP_PKEY_eq(pk, dup_pk), 1); in test_pass_rsa() 266 EVP_PKEY_free(pk); in test_pass_rsa() 267 pk = dup_pk; in test_pass_rsa() 277 EVP_PKEY_free(pk); in test_pass_rsa()
|
H A D | enginetest.c | 234 EVP_PKEY *pk = EVP_PKEY_new(); in get_test_pkey() local 236 if (rsa == NULL || pk == NULL || !EVP_PKEY_assign_RSA(pk, rsa)) { in get_test_pkey() 238 EVP_PKEY_free(pk); in get_test_pkey() 244 EVP_PKEY_free(pk); in get_test_pkey() 248 return pk; in get_test_pkey()
|
/openssl/crypto/dsa/ |
H A D | dsa_prn.c | 55 EVP_PKEY *pk; in DSA_print() local 57 pk = EVP_PKEY_new(); in DSA_print() 58 if (pk == NULL) in DSA_print() 60 ret = EVP_PKEY_set1_DSA(pk, (DSA *)x); in DSA_print() 63 EVP_PKEY_free(pk); in DSA_print() 69 EVP_PKEY *pk; in DSAparams_print() local 71 pk = EVP_PKEY_new(); in DSAparams_print() 72 if (pk == NULL) in DSAparams_print() 74 ret = EVP_PKEY_set1_DSA(pk, (DSA *)x); in DSAparams_print() 76 ret = EVP_PKEY_print_params(bp, pk, 4, NULL); in DSAparams_print() [all …]
|
/openssl/include/crypto/ |
H A D | asn1.h | 29 int (*pub_decode) (EVP_PKEY *pk, const X509_PUBKEY *pub); 30 int (*pub_encode) (X509_PUBKEY *pub, const EVP_PKEY *pk); 38 int (*pkey_size) (const EVP_PKEY *pk); 39 int (*pkey_bits) (const EVP_PKEY *pk); 40 int (*pkey_security_bits) (const EVP_PKEY *pk); 44 int (*param_missing) (const EVP_PKEY *pk); 68 int (*pkey_check) (const EVP_PKEY *pk); 69 int (*pkey_public_check) (const EVP_PKEY *pk); 70 int (*pkey_param_check) (const EVP_PKEY *pk); 78 size_t (*dirty_cnt) (const EVP_PKEY *pk); [all …]
|
H A D | evp.h | 629 ((pk)->type == EVP_PKEY_NONE && (pk)->keymgmt == NULL) 631 ((pk)->type != EVP_PKEY_NONE || (pk)->keymgmt != NULL) 634 ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL) 637 ((pk)->keydata != NULL) 640 ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL) 642 ((pk)->keymgmt != NULL) 759 void *evp_pkey_get_legacy(EVP_PKEY *pk); 783 int evp_keymgmt_util_export(const EVP_PKEY *pk, int selection, 790 int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk); 793 void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk); [all …]
|
/openssl/crypto/rsa/ |
H A D | rsa_prn.c | 40 EVP_PKEY *pk; in RSA_print() local 42 pk = EVP_PKEY_new(); in RSA_print() 43 if (pk == NULL) in RSA_print() 45 ret = EVP_PKEY_set1_RSA(pk, (RSA *)x); in RSA_print() 47 ret = EVP_PKEY_print_private(bp, pk, off, NULL); in RSA_print() 48 EVP_PKEY_free(pk); in RSA_print()
|
/openssl/crypto/store/ |
H A D | store_result.c | 191 EVP_PKEY *pk = NULL; in try_key_ref() local 256 return pk; in try_key_ref() 264 EVP_PKEY *pk = NULL; in try_key_value() local 299 return pk; in try_key_value() 310 EVP_PKEY *pk = NULL; in try_key_value_legacy() local 320 if (pk != NULL) in try_key_value_legacy() 325 if (pk == NULL in try_key_value_legacy() 377 if (pk != NULL) in try_key_value_legacy() 383 return pk; in try_key_value_legacy() 406 if (pk == NULL) in try_key() [all …]
|
/openssl/crypto/asn1/ |
H A D | ameth_lib.c | 280 int (*pub_decode) (EVP_PKEY *pk, in EVP_PKEY_asn1_set_public() 283 const EVP_PKEY *pk), in EVP_PKEY_asn1_set_public() argument 289 int (*pkey_size) (const EVP_PKEY *pk), in EVP_PKEY_asn1_set_public() 290 int (*pkey_bits) (const EVP_PKEY *pk)) in EVP_PKEY_asn1_set_public() 301 int (*priv_decode) (EVP_PKEY *pk, in EVP_PKEY_asn1_set_private() 305 const EVP_PKEY *pk), in EVP_PKEY_asn1_set_private() argument 322 int (*param_missing) (const EVP_PKEY *pk), in EVP_PKEY_asn1_set_param() 354 *pk)) in EVP_PKEY_asn1_set_security_bits() 386 int (*pkey_check) (const EVP_PKEY *pk)) in EVP_PKEY_asn1_set_check() 404 int (*set_priv_key) (EVP_PKEY *pk, in EVP_PKEY_asn1_set_set_priv_key() [all …]
|
H A D | p8_pkey.c | 54 const unsigned char **pk, int *ppklen, in PKCS8_pkey_get0() argument 59 if (pk) { in PKCS8_pkey_get0() 60 *pk = ASN1_STRING_get0_data(p8->pkey); in PKCS8_pkey_get0()
|
/openssl/doc/internal/man3/ |
H A D | evp_keymgmt_util_export_to_provider.pod | 21 int evp_keymgmt_util_export(const EVP_PKEY *pk, int selection, 25 OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk, 28 int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk); 29 int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt, 31 void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk); 38 I<keymgmt> and I<keydata> from I<pk>. This is used as a 42 (provider side key material) from the given key I<pk> to a provider 44 It maintains a cache of provider key references in I<pk> to keep track 51 I<keymgmt> in I<pk>'s cache of provided keys for operations. 52 It should only be called while holding I<pk>'s lock (read or write). [all …]
|
H A D | evp_pkey_export_to_provider.pod | 13 void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx, 17 void *evp_pkey_get_legacy(EVP_PKEY *pk); 24 evp_pkey_export_to_provider() exports the "origin" key contained in I<pk> 27 default context), the name of the legacy type of I<pk>, and the I<propquery>
|
/openssl/crypto/x509/ |
H A D | x509type.c | 18 const EVP_PKEY *pk; in X509_certificate_type() local 25 pk = X509_get0_pubkey(x); in X509_certificate_type() 27 pk = pkey; in X509_certificate_type() 29 if (pk == NULL) in X509_certificate_type() 32 switch (EVP_PKEY_get_id(pk)) { in X509_certificate_type()
|
H A D | x509_cmp.c | 477 EVP_PKEY *pk; in X509_chain_check_suiteb() local 490 pk = X509_get0_pubkey(x); in X509_chain_check_suiteb() 499 return check_suite_b(pk, -1, &tflags); in X509_chain_check_suiteb() 509 rv = check_suite_b(pk, -1, &tflags); in X509_chain_check_suiteb() 522 pk = X509_get0_pubkey(x); in X509_chain_check_suiteb() 523 rv = check_suite_b(pk, sign_nid, &tflags); in X509_chain_check_suiteb() 529 rv = check_suite_b(pk, X509_get_signature_nid(x), &tflags); in X509_chain_check_suiteb() 548 int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags) in X509_CRL_check_suiteb() argument 554 return check_suite_b(pk, sign_nid, &flags); in X509_CRL_check_suiteb() 564 int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags) in X509_CRL_check_suiteb() argument
|
H A D | v3_skid.c | 58 const unsigned char *pk; in ossl_x509_pubkey_hash() local 79 X509_PUBKEY_get0_param(NULL, &pk, &pklen, NULL, pubkey); in ossl_x509_pubkey_hash() 80 if (EVP_Digest(pk, pklen, pkey_dig, &diglen, md, NULL) in ossl_x509_pubkey_hash()
|
H A D | x_pubkey.c | 325 X509_PUBKEY *pk = NULL; in X509_PUBKEY_set() local 333 if ((pk = X509_PUBKEY_new()) == NULL) { in X509_PUBKEY_set() 338 if (!pkey->ameth->pub_encode(pk, pkey)) { in X509_PUBKEY_set() 364 if (pk == NULL) { in X509_PUBKEY_set() 374 *x = pk; 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() 393 X509_PUBKEY_free(pk); in X509_PUBKEY_set() 1034 if (pk) { in X509_PUBKEY_get0_param() [all …]
|
/openssl/doc/man3/ |
H A D | EVP_PKEY_ASN1_METHOD.pod | 159 int (*pub_decode) (EVP_PKEY *pk, const X509_PUBKEY *pub); 166 encode B<X509_PUBKEY> ASN.1 parameters to / from B<pk>. 195 int (*pkey_size) (const EVP_PKEY *pk); 196 int (*pkey_bits) (const EVP_PKEY *pk); 197 int (*pkey_security_bits) (const EVP_PKEY *pk); 208 int (*param_missing) (const EVP_PKEY *pk); 215 encode DER formatted parameters to / from B<pk>. 344 int (*pkey_check) (const EVP_PKEY *pk); 345 int (*pkey_public_check) (const EVP_PKEY *pk); 346 int (*pkey_param_check) (const EVP_PKEY *pk); [all …]
|
/openssl/crypto/cms/ |
H A D | cms_env.c | 361 EVP_PKEY_up_ref(pk); in cms_RecipientInfo_ktri_init() 363 ktri->pkey = pk; in cms_RecipientInfo_ktri_init() 389 EVP_PKEY *pk = NULL; in CMS_add1_recipient() local 403 pk = X509_get0_pubkey(recip); in CMS_add1_recipient() 404 if (pk == NULL) { in CMS_add1_recipient() 459 if (pk) in CMS_RecipientInfo_ktri_get0_algs() 460 *pk = ktri->pkey; in CMS_RecipientInfo_ktri_get0_algs() 1352 if (pk->ameth && pk->ameth->pkey_ctrl) { in ossl_cms_pkey_get_ri_type() 1354 i = pk->ameth->pkey_ctrl(pk, ASN1_PKEY_CTRL_CMS_RI_TYPE, 0, &r); in ossl_cms_pkey_get_ri_type() 1365 if (pk->ameth != NULL && pk->ameth->pkey_ctrl != NULL) { in ossl_cms_pkey_is_ri_type_supported() [all …]
|
H A D | cms_dh.c | 28 EVP_PKEY *pkpeer = NULL, *pk = NULL; in dh_cms_set_peerkey() local 41 pk = EVP_PKEY_CTX_get0_pkey(pctx); in dh_cms_set_peerkey() 42 if (pk == NULL || !EVP_PKEY_is_a(pk, "DHX")) in dh_cms_set_peerkey() 57 plen = EVP_PKEY_get_size(pk); in dh_cms_set_peerkey() 67 || !EVP_PKEY_copy_parameters(pkpeer, pk) in dh_cms_set_peerkey()
|
H A D | cms_smime.c | 699 CMS_RecipientInfo_kari_set0_pkey_and_peer(ri, pk, peer); in cms_kari_set1_pkey_and_peer() 711 return CMS_decrypt_set1_pkey_and_peer(cms, pk, cert, NULL); in CMS_decrypt_set1_pkey() 714 int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk, in CMS_decrypt_set1_pkey_and_peer() argument 733 cms_pkey_ri_type = ossl_cms_pkey_get_ri_type(pk); in CMS_decrypt_set1_pkey_and_peer() 744 if (!ossl_cms_pkey_is_ri_type_supported(pk, ri_type)) in CMS_decrypt_set1_pkey_and_peer() 748 r = cms_kari_set1_pkey_and_peer(cms, ri, pk, cert, peer); in CMS_decrypt_set1_pkey_and_peer() 756 EVP_PKEY_up_ref(pk); in CMS_decrypt_set1_pkey_and_peer() 757 CMS_RecipientInfo_set0_pkey(ri, pk); in CMS_decrypt_set1_pkey_and_peer() 870 int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert, in CMS_decrypt() argument 888 if (pk == NULL && cert == NULL && dcont == NULL && out == NULL) in CMS_decrypt() [all …]
|
H A D | cms_kari.c | 163 EVP_PKEY *pk, X509 *peer) in CMS_RecipientInfo_kari_set0_pkey_and_peer() argument 170 if (pk == NULL) in CMS_RecipientInfo_kari_set0_pkey_and_peer() 174 pk, in CMS_RecipientInfo_kari_set0_pkey_and_peer() 193 int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk) in CMS_RecipientInfo_kari_set0_pkey() argument 195 return CMS_RecipientInfo_kari_set0_pkey_and_peer(ri, pk, NULL); in CMS_RecipientInfo_kari_set0_pkey() 284 EVP_PKEY *pk) in cms_kari_create_ephemeral_key() argument 293 pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pk, propq); in cms_kari_create_ephemeral_key()
|
/openssl/crypto/pem/ |
H A D | pvkfmt.c | 573 if (EVP_PKEY_is_a(pk, "RSA")) { in do_i2b() 577 } else if (EVP_PKEY_is_a(pk, "DSA")) { in do_i2b() 610 write_rsa(&p, EVP_PKEY_get0_RSA(pk), ispub); in do_i2b() 613 write_dsa(&p, EVP_PKEY_get0_DSA(pk), ispub); in do_i2b() 626 outlen = do_i2b(&tmp, pk, ispub); in do_i2b_bio() 752 return do_i2b_bio(out, pk, 0); in i2b_PrivateKey_bio() 755 int i2b_PublicKey_bio(BIO *out, const EVP_PKEY *pk) in i2b_PublicKey_bio() argument 757 return do_i2b_bio(out, pk, 1); in i2b_PublicKey_bio() 1026 pklen = do_i2b(NULL, pk, 0); in i2b_PVK() 1046 if (EVP_PKEY_get_id(pk) == EVP_PKEY_RSA) in i2b_PVK() [all …]
|
/openssl/crypto/encode_decode/ |
H A D | encoder_pkey.c | 158 const EVP_PKEY *pk; member 187 const EVP_PKEY *pk = data->pk; in encoder_construct_pkey() local 188 const OSSL_PROVIDER *k_prov = EVP_KEYMGMT_get0_provider(pk->keymgmt); in encoder_construct_pkey() 194 if (!evp_keymgmt_export(pk->keymgmt, pk->keydata, data->selection, in encoder_construct_pkey() 199 data->obj = pk->keydata; in encoder_construct_pkey() 325 data->pk = pkey; in ossl_encoder_ctx_setup_for_pkey()
|