/openssl/crypto/evp/ |
H A D | m_sigver.c | 341 if (pctx) in do_sigver_init() 342 *pctx = ctx->pctx; in do_sigver_init() 398 EVP_PKEY_CTX *pctx = ctx->pctx; in EVP_DigestSignUpdate() local 433 EVP_PKEY_CTX *pctx = ctx->pctx; in EVP_DigestVerifyUpdate() local 471 EVP_PKEY_CTX *dctx = NULL, *pctx = ctx->pctx; in EVP_DigestSignFinal() local 500 if (pctx == NULL || pctx->pmeth == NULL) { in EVP_DigestSignFinal() 507 && !ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx)) in EVP_DigestSignFinal() 576 EVP_PKEY_CTX *pctx = ctx->pctx; in EVP_DigestSign() local 613 EVP_PKEY_CTX *dctx = NULL, *pctx = ctx->pctx; in EVP_DigestVerifyFinal() local 641 if (pctx == NULL || pctx->pmeth == NULL) { in EVP_DigestVerifyFinal() [all …]
|
H A D | digest.c | 645 out->pctx = EVP_PKEY_CTX_dup(in->pctx); in EVP_MD_CTX_copy_ex() 698 if (in->pctx) { in EVP_MD_CTX_copy_ex() 699 out->pctx = EVP_PKEY_CTX_dup(in->pctx); in EVP_MD_CTX_copy_ex() 765 EVP_PKEY_CTX *pctx = ctx->pctx; in EVP_MD_CTX_set_params() local 768 if (pctx != NULL in EVP_MD_CTX_set_params() 802 pctx = ctx->pctx; in EVP_MD_CTX_settable_params() 803 if (pctx != NULL in EVP_MD_CTX_settable_params() 821 EVP_PKEY_CTX *pctx = ctx->pctx; in EVP_MD_CTX_get_params() local 824 if (pctx != NULL in EVP_MD_CTX_get_params() 858 pctx = ctx->pctx; in EVP_MD_CTX_gettable_params() [all …]
|
H A D | p_seal.c | 26 EVP_PKEY_CTX *pctx = NULL; in EVP_SealInit() local 59 pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pubk[i], NULL); in EVP_SealInit() 60 if (pctx == NULL) { in EVP_SealInit() 65 if (EVP_PKEY_encrypt_init(pctx) <= 0 in EVP_SealInit() 66 || EVP_PKEY_encrypt(pctx, ek[i], &keylen, key, keylen) <= 0) in EVP_SealInit() 69 EVP_PKEY_CTX_free(pctx); in EVP_SealInit() 71 pctx = NULL; in EVP_SealInit() 74 EVP_PKEY_CTX_free(pctx); in EVP_SealInit()
|
H A D | p_open.c | 25 EVP_PKEY_CTX *pctx = NULL; in EVP_OpenInit() local 36 if ((pctx = EVP_PKEY_CTX_new(priv, NULL)) == NULL) { in EVP_OpenInit() 41 if (EVP_PKEY_decrypt_init(pctx) <= 0 in EVP_OpenInit() 42 || EVP_PKEY_decrypt(pctx, NULL, &keylen, ek, ekl) <= 0) in EVP_OpenInit() 48 if (EVP_PKEY_decrypt(pctx, key, &keylen, ek, ekl) <= 0) in EVP_OpenInit() 57 EVP_PKEY_CTX_free(pctx); in EVP_OpenInit()
|
H A D | pmeth_lib.c | 455 if (pctx->engine && !ENGINE_init(pctx->engine)) { in EVP_PKEY_CTX_dup() 464 if (pctx->pkey != NULL) in EVP_PKEY_CTX_dup() 466 rctx->pkey = pctx->pkey; in EVP_PKEY_CTX_dup() 490 = pctx->op.kex.exchange->dupctx(pctx->op.kex.algctx); in EVP_PKEY_CTX_dup() 511 = pctx->op.sig.signature->dupctx(pctx->op.sig.algctx); in EVP_PKEY_CTX_dup() 532 = pctx->op.ciph.cipher->dupctx(pctx->op.ciph.algctx); in EVP_PKEY_CTX_dup() 553 = pctx->op.encap.kem->dupctx(pctx->op.encap.algctx); in EVP_PKEY_CTX_dup() 567 rctx->pmeth = pctx->pmeth; in EVP_PKEY_CTX_dup() 572 if (pctx->peerkey != NULL) in EVP_PKEY_CTX_dup() 581 provkey = evp_pkey_export_to_provider(pctx->pkey, pctx->libctx, in EVP_PKEY_CTX_dup() [all …]
|
H A D | ctrl_params_translate.c | 167 EVP_PKEY_CTX *pctx; member 2044 if (!EVP_PKEY_CTX_IS_GEN_OP(ctx->pctx)) in fix_group_ecx() 2715 keytype = pctx->legacy_keytype; in evp_pkey_ctx_ctrl_to_param() 2726 if (pctx->pmeth != NULL in evp_pkey_ctx_ctrl_to_param() 2737 ctx.pctx = pctx; in evp_pkey_ctx_ctrl_to_param() 2779 int keytype = pctx->legacy_keytype; in evp_pkey_ctx_ctrl_str_to_param() 2780 int optype = pctx->operation == 0 ? -1 : pctx->operation; in evp_pkey_ctx_ctrl_str_to_param() 2803 ctx.pctx = pctx; in evp_pkey_ctx_ctrl_str_to_param() 2838 int keytype = pctx->legacy_keytype; in evp_pkey_ctx_setget_params_to_ctrl() 2839 int optype = pctx->operation == 0 ? -1 : pctx->operation; in evp_pkey_ctx_setget_params_to_ctrl() [all …]
|
/openssl/test/ |
H A D | pkey_meth_kdf_test.c | 22 EVP_PKEY_CTX *pctx; in test_kdf_tls1_prf() local 30 if (EVP_PKEY_derive_init(pctx) <= 0) { in test_kdf_tls1_prf() 38 if (EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, in test_kdf_tls1_prf() 44 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, in test_kdf_tls1_prf() 77 EVP_PKEY_CTX_free(pctx); in test_kdf_tls1_prf() 84 EVP_PKEY_CTX *pctx; in test_kdf_hkdf() local 92 if (EVP_PKEY_derive_init(pctx) <= 0) { in test_kdf_hkdf() 143 EVP_PKEY_CTX_free(pctx); in test_kdf_hkdf() 151 EVP_PKEY_CTX *pctx; in test_kdf_scrypt() local 159 if (EVP_PKEY_derive_init(pctx) <= 0) { in test_kdf_scrypt() [all …]
|
H A D | evp_pkey_ctx_new_from_name.c | 8 EVP_PKEY_CTX *pctx = NULL; in main() local 10 pctx = EVP_PKEY_CTX_new_from_name(NULL, "NO_SUCH_ALGORITHM", NULL); in main() 11 EVP_PKEY_CTX_free(pctx); in main()
|
H A D | provider_status_test.c | 151 EVP_PKEY_CTX *pctx = NULL; in test_provider_status() local 170 if (!TEST_ptr((pctx = EVP_PKEY_CTX_new_from_name(libctx, "RSA", NULL))) in test_provider_status() 171 || !TEST_int_gt(EVP_PKEY_keygen_init(pctx), 0) in test_provider_status() 172 || !TEST_int_gt(EVP_PKEY_CTX_set_rsa_keygen_bits(pctx, 2048), 0) in test_provider_status() 173 || !TEST_int_gt(EVP_PKEY_keygen(pctx, &pkey), 0)) in test_provider_status() 176 EVP_PKEY_CTX_free(pctx); in test_provider_status() 178 pctx = NULL; in test_provider_status()
|
H A D | bad_dtls_test.c | 70 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL); in do_PRF() local 74 EVP_PKEY_derive_init(pctx); in do_PRF() 75 EVP_PKEY_CTX_set_tls1_prf_md(pctx, EVP_md5_sha1()); in do_PRF() 76 EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, master_secret, sizeof(master_secret)); in do_PRF() 77 EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed1, seed1_len); in do_PRF() 78 EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed2, seed2_len); in do_PRF() 79 EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed3, seed3_len); in do_PRF() 80 EVP_PKEY_derive(pctx, out, &outlen); in do_PRF() 81 EVP_PKEY_CTX_free(pctx); in do_PRF()
|
H A D | evp_extra_test.c | 957 EVP_PKEY_CTX_free(pctx); in make_key_fromdata() 2292 EVP_PKEY_CTX_free(pctx); in test_EC_keygen_with_enc() 2365 EVP_PKEY_CTX_free(pctx); in test_EVP_SM2_verify() 2559 EVP_PKEY_CTX_free(pctx); in test_EVP_SM2() 2862 EVP_PKEY_CTX *pctx; in test_HKDF() local 2899 EVP_PKEY_CTX_free(pctx); in test_HKDF() 2906 EVP_PKEY_CTX *pctx; in test_emptyikm_HKDF() local 2940 EVP_PKEY_CTX_free(pctx); in test_emptyikm_HKDF() 2947 EVP_PKEY_CTX *pctx; in test_empty_salt_info_HKDF() local 3673 if (expect_null ? !TEST_ptr_null(pctx) : !TEST_ptr(pctx)) in test_pkey_ctx_fail_without_provider() [all …]
|
/openssl/crypto/cms/ |
H A D | cms_ec.c | 24 EVP_PKEY_CTX *pctx = NULL; in pkey_type2param() local 50 if (pctx == NULL || EVP_PKEY_paramgen_init(pctx) <= 0) in pkey_type2param() 59 EVP_PKEY_CTX_free(pctx); in pkey_type2param() 68 EVP_PKEY_CTX_free(pctx); in pkey_type2param() 92 pk = EVP_PKEY_CTX_get0_pkey(pctx); in ecdh_cms_set_peerkey() 191 kekcipher = EVP_CIPHER_fetch(pctx->libctx, name, pctx->propquery); in ecdh_cms_set_shared_info() 222 EVP_PKEY_CTX *pctx; in ecdh_cms_decrypt() local 225 if (pctx == NULL) in ecdh_cms_decrypt() 252 EVP_PKEY_CTX *pctx; in ecdh_cms_encrypt() local 268 if (pctx == NULL) in ecdh_cms_encrypt() [all …]
|
H A D | cms_dh.c | 20 static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx, in dh_cms_set_peerkey() argument 41 pk = EVP_PKEY_CTX_get0_pkey(pctx); in dh_cms_set_peerkey() 125 kekcipher = EVP_CIPHER_fetch(pctx->libctx, name, pctx->propquery); in dh_cms_set_shared_info() 138 if (EVP_PKEY_CTX_set0_dh_kdf_oid(pctx, in dh_cms_set_shared_info() 166 if (pctx == NULL) in dh_cms_decrypt() 169 if (!EVP_PKEY_CTX_get0_peerkey(pctx)) { in dh_cms_decrypt() 184 if (!dh_cms_set_shared_info(pctx, ri)) { in dh_cms_decrypt() 193 EVP_PKEY_CTX *pctx; in dh_cms_encrypt() local 209 pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); in dh_cms_encrypt() 210 if (pctx == NULL) in dh_cms_encrypt() [all …]
|
H A D | cms_kari.c | 165 EVP_PKEY_CTX *pctx; in CMS_RecipientInfo_kari_set0_pkey_and_peer() local 169 kari->pctx = NULL; in CMS_RecipientInfo_kari_set0_pkey_and_peer() 176 if (pctx == NULL || EVP_PKEY_derive_init(pctx) <= 0) in CMS_RecipientInfo_kari_set0_pkey_and_peer() 186 kari->pctx = pctx; in CMS_RecipientInfo_kari_set0_pkey_and_peer() 189 EVP_PKEY_CTX_free(pctx); in CMS_RecipientInfo_kari_set0_pkey_and_peer() 249 kari->pctx = NULL; in cms_kek_cipher() 294 if (pctx == NULL) in cms_kari_create_ephemeral_key() 302 if (pctx == NULL) in cms_kari_create_ephemeral_key() 306 kari->pctx = pctx; in cms_kari_create_ephemeral_key() 326 if (pctx == NULL) in cms_kari_set_originator_private_key() [all …]
|
H A D | cms_sd.c | 366 si->pctx = NULL; in CMS_add1_signer() 588 return si->pctx; in CMS_SignerInfo_get0_pkey_ctx() 764 pctx = si->pctx; in cms_SignerInfo_content_sign() 765 si->pctx = NULL; in cms_SignerInfo_content_sign() 850 if (si->pctx) { in CMS_SignerInfo_sign() 851 pctx = si->pctx; in CMS_SignerInfo_sign() 860 si->pctx = pctx; in CMS_SignerInfo_sign() 933 si->pctx = NULL; in CMS_SignerInfo_verify() 937 si->pctx = NULL; in CMS_SignerInfo_verify() 1055 si->pctx = pkctx; in CMS_SignerInfo_verify_content() [all …]
|
H A D | cms_env.c | 117 EVP_PKEY_CTX *pctx = ri->d.kari->pctx; in ossl_cms_env_asn1_ctrl() local 119 if (pctx == NULL) in ossl_cms_env_asn1_ctrl() 370 if (ktri->pctx == NULL) in cms_RecipientInfo_ktri_init() 511 EVP_PKEY_CTX *pctx; in cms_RecipientInfo_ktri_encrypt() local 525 pctx = ktri->pctx; in cms_RecipientInfo_ktri_encrypt() 527 if (pctx) { in cms_RecipientInfo_ktri_encrypt() 534 if (pctx == NULL) in cms_RecipientInfo_ktri_encrypt() 557 EVP_PKEY_CTX_free(pctx); in cms_RecipientInfo_ktri_encrypt() 558 ktri->pctx = NULL; in cms_RecipientInfo_ktri_encrypt() 614 if (ktri->pctx == NULL) in cms_RecipientInfo_ktri_decrypt() [all …]
|
/openssl/crypto/asn1/ |
H A D | tasn_prn.c | 113 const ASN1_PCTX *pctx); 117 const ASN1_PCTX *pctx); 123 if (pctx == NULL) in ASN1_item_print() 124 pctx = &default_pctx; in ASN1_item_print() 125 if (pctx->flags & ASN1_PCTX_FLAGS_NO_STRUCT_NAME) in ASN1_item_print() 147 parg.pctx = pctx; in asn1_item_print_ctx() 273 if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME) in asn1_template_print_ctx() 313 pctx)) in asn1_template_print_ctx() 331 const ASN1_PCTX *pctx) in asn1_print_fsname() argument 345 if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME) in asn1_print_fsname() [all …]
|
/openssl/fuzz/ |
H A D | decoder.c | 16 static ASN1_PCTX *pctx; variable 26 pctx = ASN1_PCTX_new(); in FuzzerInitialize() 27 ASN1_PCTX_set_flags(pctx, ASN1_PCTX_FLAGS_SHOW_ABSENT in FuzzerInitialize() 32 ASN1_PCTX_set_str_flags(pctx, ASN1_STRFLGS_UTF8_CONVERT in FuzzerInitialize() 57 EVP_PKEY_print_public(bio, pkey, 1, pctx); in FuzzerTestOneInput() 58 EVP_PKEY_print_private(bio, pkey, 1, pctx); in FuzzerTestOneInput() 59 EVP_PKEY_print_params(bio, pkey, 1, pctx); in FuzzerTestOneInput() 94 ASN1_PCTX_free(pctx); in FuzzerCleanup()
|
/openssl/doc/man3/ |
H A D | EVP_PKEY_print_private.pod | 14 int indent, ASN1_PCTX *pctx); 16 int indent, ASN1_PCTX *pctx); 18 int indent, ASN1_PCTX *pctx); 20 int indent, ASN1_PCTX *pctx); 22 int indent, ASN1_PCTX *pctx); 24 int indent, ASN1_PCTX *pctx); 33 The I<pctx> parameter allows the print output to be finely tuned by using 34 ASN1 printing options. If I<pctx> is set to NULL then default values will 43 Currently no public key algorithms include any options in the I<pctx> parameter.
|
H A D | EVP_PKEY_CTX_set_tls1_prf_md.pod | 13 int EVP_PKEY_CTX_set_tls1_prf_md(EVP_PKEY_CTX *pctx, const EVP_MD *md); 14 int EVP_PKEY_CTX_set1_tls1_prf_secret(EVP_PKEY_CTX *pctx, 16 int EVP_PKEY_CTX_add1_tls1_prf_seed(EVP_PKEY_CTX *pctx, 51 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL); 76 EVP_PKEY_CTX *pctx; 80 pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL); 81 if (EVP_PKEY_derive_init(pctx) <= 0) 83 if (EVP_PKEY_CTX_set_tls1_prf_md(pctx, EVP_sha256()) <= 0) 85 if (EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, "secret", 6) <= 0) 87 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, "seed", 4) <= 0) [all …]
|
H A D | EVP_PKEY_CTX_set_hkdf_md.pod | 14 int EVP_PKEY_CTX_set_hkdf_mode(EVP_PKEY_CTX *pctx, int mode); 16 int EVP_PKEY_CTX_set_hkdf_md(EVP_PKEY_CTX *pctx, const EVP_MD *md); 100 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); 127 EVP_PKEY_CTX *pctx; 130 pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); 132 if (EVP_PKEY_derive_init(pctx) <= 0) 134 if (EVP_PKEY_CTX_set_hkdf_md(pctx, EVP_sha256()) <= 0) 136 if (EVP_PKEY_CTX_set1_hkdf_salt(pctx, "salt", 4) <= 0) 138 if (EVP_PKEY_CTX_set1_hkdf_key(pctx, "secret", 6) <= 0) 140 if (EVP_PKEY_CTX_add1_hkdf_info(pctx, "label", 5) <= 0) [all …]
|
/openssl/doc/man7/ |
H A D | X25519.pod | 24 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL); 28 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X448, NULL); 49 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL); 50 EVP_PKEY_keygen_init(pctx); 51 EVP_PKEY_keygen(pctx, &pkey); 52 EVP_PKEY_CTX_free(pctx);
|
/openssl/apps/ |
H A D | testdsa.h | 220 EVP_PKEY_CTX *pctx; in get_dsa() local 239 if ((pctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL)) == NULL) in get_dsa() 265 if (EVP_PKEY_fromdata_init(pctx) <= 0 in get_dsa() 266 || EVP_PKEY_fromdata(pctx, &pkey, EVP_PKEY_KEYPAIR, in get_dsa() 277 EVP_PKEY_CTX_free(pctx); in get_dsa()
|
/openssl/test/helpers/ |
H A D | predefined_dhparams.c | 21 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_name(libctx, type, NULL); in get_dh_from_pg_bn() local 26 if (pctx == NULL || EVP_PKEY_fromdata_init(pctx) <= 0) in get_dh_from_pg_bn() 38 || EVP_PKEY_fromdata(pctx, &dhpkey, EVP_PKEY_KEY_PARAMETERS, params) <= 0) in get_dh_from_pg_bn() 42 EVP_PKEY_CTX_free(pctx); in get_dh_from_pg_bn()
|
/openssl/crypto/hpke/ |
H A D | hpke.c | 452 EVP_PKEY_CTX *pctx = NULL; in hpke_encap() local 485 if (pctx == NULL) { in hpke_encap() 534 EVP_PKEY_CTX_free(pctx); in hpke_encap() 552 EVP_PKEY_CTX *pctx = NULL; in hpke_decap() local 567 if (pctx == NULL) { in hpke_decap() 626 EVP_PKEY_CTX_free(pctx); in hpke_decap() 1297 EVP_PKEY_CTX *pctx = NULL; in OSSL_HPKE_keygen() local 1324 if (pctx == NULL in OSSL_HPKE_keygen() 1341 EVP_PKEY_CTX_free(pctx); in OSSL_HPKE_keygen() 1342 pctx = NULL; in OSSL_HPKE_keygen() [all …]
|