/freebsd/crypto/openssl/crypto/evp/ |
H A D | m_sigver.c | 39 static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, in do_sigver_init() argument 64 if (ctx->pctx == NULL) { in do_sigver_init() 67 ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props); in do_sigver_init() 69 ctx->pctx = EVP_PKEY_CTX_new(pkey, e); in do_sigver_init() 71 if (ctx->pctx == NULL) in do_sigver_init() 74 locpctx = ctx->pctx; in do_sigver_init() 213 if (pctx != NULL) in do_sigver_init() 214 *pctx = locpctx; in do_sigver_init() 304 if (ctx->pctx->pmeth == NULL) { in do_sigver_init() 309 if (!(ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)) { in do_sigver_init() [all …]
|
H A D | digest.c | 86 EVP_PKEY_CTX_free(ctx->pctx); in evp_md_ctx_reset_ex() 87 ctx->pctx = NULL; in evp_md_ctx_reset_ex() 109 EVP_PKEY_CTX *pctx = NULL; in evp_md_ctx_new_ex() local 112 || (pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq)) == NULL) { in evp_md_ctx_new_ex() 117 if (id != NULL && EVP_PKEY_CTX_set1_id(pctx, id->data, id->length) <= 0) in evp_md_ctx_new_ex() 120 EVP_MD_CTX_set_pkey_ctx(ctx, pctx); in evp_md_ctx_new_ex() 124 EVP_PKEY_CTX_free(pctx); in evp_md_ctx_new_ex() 152 if (ctx->pctx != NULL in evp_md_init_internal() 153 && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx) in evp_md_init_internal() 154 && ctx->pctx->op.sig.algctx != NULL) { in evp_md_init_internal() [all …]
|
H A D | p_seal.c | 27 EVP_PKEY_CTX *pctx = NULL; in EVP_SealInit() local 60 pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pubk[i], NULL); in EVP_SealInit() 61 if (pctx == NULL) { in EVP_SealInit() 66 if (EVP_PKEY_encrypt_init(pctx) <= 0 in EVP_SealInit() 67 || EVP_PKEY_encrypt(pctx, ek[i], &keylen, key, keylen) <= 0) in EVP_SealInit() 70 EVP_PKEY_CTX_free(pctx); in EVP_SealInit() 72 pctx = NULL; in EVP_SealInit() 75 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() 50 if (EVP_PKEY_decrypt(pctx, key, &keylen, ek, ekl) <= 0) in EVP_OpenInit() 59 EVP_PKEY_CTX_free(pctx); in EVP_OpenInit()
|
H A D | pmeth_lib.c | 473 EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *pctx) in EVP_PKEY_CTX_dup() argument 479 if (pctx->engine && !ENGINE_init(pctx->engine)) { in EVP_PKEY_CTX_dup() 490 if (pctx->pkey != NULL) in EVP_PKEY_CTX_dup() 491 EVP_PKEY_up_ref(pctx->pkey); in EVP_PKEY_CTX_dup() 492 rctx->pkey = pctx->pkey; in EVP_PKEY_CTX_dup() 493 rctx->operation = pctx->operation; in EVP_PKEY_CTX_dup() 494 rctx->libctx = pctx->libctx; in EVP_PKEY_CTX_dup() 495 rctx->keytype = pctx->keytype; in EVP_PKEY_CTX_dup() 497 if (pctx->propquery != NULL) { in EVP_PKEY_CTX_dup() 498 rctx->propquery = OPENSSL_strdup(pctx->propquery); in EVP_PKEY_CTX_dup() [all …]
|
/freebsd/crypto/openssl/test/ |
H A D | pkey_meth_kdf_test.c | 22 EVP_PKEY_CTX *pctx; in test_kdf_tls1_prf() local 26 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL)) == NULL) { in test_kdf_tls1_prf() 30 if (EVP_PKEY_derive_init(pctx) <= 0) { in test_kdf_tls1_prf() 34 if (EVP_PKEY_CTX_set_tls1_prf_md(pctx, EVP_sha256()) <= 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() 50 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, in test_kdf_tls1_prf() 55 if (EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, in test_kdf_tls1_prf() 61 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) { in test_kdf_tls1_prf() 77 EVP_PKEY_CTX_free(pctx); in test_kdf_hkdf() 71 EVP_PKEY_CTX *pctx; test_kdf_hkdf() local 125 EVP_PKEY_CTX *pctx; test_kdf_scrypt() local [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()
|
/freebsd/crypto/openssl/crypto/cms/ |
H A D | cms_ec.c | 23 EVP_PKEY_CTX *pctx = NULL; in pkey_type2param() local 48 pctx = EVP_PKEY_CTX_new_from_name(libctx, "EC", propq); in pkey_type2param() 49 if (pctx == NULL || EVP_PKEY_paramgen_init(pctx) <= 0) in pkey_type2param() 52 || EVP_PKEY_CTX_set_group_name(pctx, groupname) <= 0) { in pkey_type2param() 56 if (EVP_PKEY_paramgen(pctx, &pkey) <= 0) in pkey_type2param() 58 EVP_PKEY_CTX_free(pctx); in pkey_type2param() 67 EVP_PKEY_CTX_free(pctx); in pkey_type2param() 72 static int ecdh_cms_set_peerkey(EVP_PKEY_CTX *pctx, in ecdh_cms_set_peerkey() argument 91 pk = EVP_PKEY_CTX_get0_pkey(pctx); in ecdh_cms_set_peerkey() 102 EVP_PKEY_CTX_get0_libctx(pctx), in ecdh_cms_set_peerkey() [all …]
|
H A D | cms_dh.c | 19 static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx, in dh_cms_set_peerkey() argument 40 pk = EVP_PKEY_CTX_get0_pkey(pctx); in dh_cms_set_peerkey() 70 if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0) in dh_cms_set_peerkey() 80 static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) in dh_cms_set_shared_info() argument 105 if (EVP_PKEY_CTX_set_dh_kdf_type(pctx, EVP_PKEY_DH_KDF_X9_42) <= 0 in dh_cms_set_shared_info() 106 || EVP_PKEY_CTX_set_dh_kdf_md(pctx, EVP_sha1()) <= 0) in dh_cms_set_shared_info() 124 kekcipher = EVP_CIPHER_fetch(pctx->libctx, name, pctx->propquery); in dh_cms_set_shared_info() 134 if (EVP_PKEY_CTX_set_dh_kdf_outlen(pctx, keylen) <= 0) in dh_cms_set_shared_info() 137 if (EVP_PKEY_CTX_set0_dh_kdf_oid(pctx, in dh_cms_set_shared_info() 149 if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, dukmlen) <= 0) in dh_cms_set_shared_info() [all …]
|
H A D | cms_kari.c | 165 EVP_PKEY_CTX *pctx; in CMS_RecipientInfo_kari_set0_pkey_and_peer() local 168 EVP_PKEY_CTX_free(kari->pctx); in CMS_RecipientInfo_kari_set0_pkey_and_peer() 169 kari->pctx = NULL; in CMS_RecipientInfo_kari_set0_pkey_and_peer() 173 pctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(kari->cms_ctx), 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() 182 if (EVP_PKEY_derive_set_peer(pctx, pub_pkey) <= 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() 225 if (EVP_PKEY_derive(kari->pctx, kek, &keklen) <= 0) in cms_kek_cipher() 248 EVP_PKEY_CTX_free(kari->pctx); in cms_kek_cipher() [all …]
|
H A D | cms_env.c | 126 EVP_PKEY_CTX *pctx = ri->d.kari->pctx; in ossl_cms_env_asn1_ctrl() local 128 if (pctx == NULL) in ossl_cms_env_asn1_ctrl() 130 pkey = EVP_PKEY_CTX_get0_pkey(pctx); in ossl_cms_env_asn1_ctrl() 229 return ri->d.ktri->pctx; in CMS_RecipientInfo_get0_pkey_ctx() 231 return ri->d.kari->pctx; in CMS_RecipientInfo_get0_pkey_ctx() 336 ktri->pctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(ctx), in cms_RecipientInfo_ktri_init() 339 if (ktri->pctx == NULL) in cms_RecipientInfo_ktri_init() 341 if (EVP_PKEY_encrypt_init(ktri->pctx) <= 0) in cms_RecipientInfo_ktri_init() 478 EVP_PKEY_CTX *pctx; in cms_RecipientInfo_ktri_encrypt() local 492 pctx = ktri->pctx; in cms_RecipientInfo_ktri_encrypt() [all …]
|
H A D | cms_sd.c | 335 si->pctx = NULL; in CMS_add1_signer() 471 si->pctx = EVP_PKEY_CTX_new_from_pkey(ossl_cms_ctx_get0_libctx(ctx), in CMS_add1_signer() 474 if (si->pctx == NULL) in CMS_add1_signer() 476 if (EVP_PKEY_sign_init(si->pctx) <= 0) in CMS_add1_signer() 478 if (EVP_PKEY_CTX_set_signature_md(si->pctx, md) <= 0) in CMS_add1_signer() 480 } else if (EVP_DigestSignInit_ex(si->mctx, &si->pctx, in CMS_add1_signer() 553 return si->pctx; in CMS_SignerInfo_get0_pkey_ctx() 683 EVP_PKEY_CTX *pctx = NULL; in cms_SignerInfo_content_sign() local 699 if (si->pctx && !cms_sd_asn1_ctrl(si, 0)) in cms_SignerInfo_content_sign() 721 } else if (si->pctx) { in cms_SignerInfo_content_sign() [all …]
|
/freebsd/crypto/openssl/crypto/asn1/ |
H A D | tasn_prn.c | 107 int nohdr, const ASN1_PCTX *pctx); 110 const ASN1_TEMPLATE *tt, const ASN1_PCTX *pctx); 115 const ASN1_PCTX *pctx); 119 const ASN1_PCTX *pctx); 122 const ASN1_ITEM *it, const ASN1_PCTX *pctx) in ASN1_item_print() argument 125 if (pctx == NULL) in ASN1_item_print() 126 pctx = &default_pctx; in ASN1_item_print() 127 if (pctx->flags & ASN1_PCTX_FLAGS_NO_STRUCT_NAME) in ASN1_item_print() 131 return asn1_item_print_ctx(out, &ifld, indent, it, NULL, sname, 0, pctx); in ASN1_item_print() 137 int nohdr, const ASN1_PCTX *pctx) in asn1_item_print_ctx() argument [all …]
|
/freebsd/contrib/bearssl/src/ssl/ |
H A D | ssl_ccert_single_rsa.c | 28 cc_none0(const br_ssl_client_certificate_class **pctx) in cc_none0() argument 30 (void)pctx; in cc_none0() 34 cc_none1(const br_ssl_client_certificate_class **pctx, size_t len) in cc_none1() argument 36 (void)pctx; in cc_none1() 41 cc_none2(const br_ssl_client_certificate_class **pctx, in cc_none2() argument 44 (void)pctx; in cc_none2() 50 cc_choose(const br_ssl_client_certificate_class **pctx, in cc_choose() argument 58 zc = (br_ssl_client_certificate_rsa_context *)pctx; in cc_choose() 101 cc_do_sign(const br_ssl_client_certificate_class **pctx, in cc_do_sign() argument 109 zc = (br_ssl_client_certificate_rsa_context *)pctx; in cc_do_sign()
|
H A D | ssl_ccert_single_ec.c | 28 cc_none0(const br_ssl_client_certificate_class **pctx) in cc_none0() argument 30 (void)pctx; in cc_none0() 34 cc_none1(const br_ssl_client_certificate_class **pctx, size_t len) in cc_none1() argument 36 (void)pctx; in cc_none1() 41 cc_none2(const br_ssl_client_certificate_class **pctx, in cc_none2() argument 44 (void)pctx; in cc_none2() 50 cc_choose(const br_ssl_client_certificate_class **pctx, in cc_choose() argument 58 zc = (br_ssl_client_certificate_ec_context *)pctx; in cc_choose() 91 cc_do_keyx(const br_ssl_client_certificate_class **pctx, in cc_do_keyx() argument 98 zc = (br_ssl_client_certificate_ec_context *)pctx; in cc_do_keyx() [all …]
|
H A D | ssl_scert_single_rsa.c | 28 sr_choose(const br_ssl_server_policy_class **pctx, in sr_choose() argument 38 pc = (br_ssl_server_policy_rsa_context *)pctx; in sr_choose() 74 sr_do_keyx(const br_ssl_server_policy_class **pctx, in sr_do_keyx() argument 79 pc = (br_ssl_server_policy_rsa_context *)pctx; in sr_do_keyx() 115 sr_do_sign(const br_ssl_server_policy_class **pctx, in sr_do_sign() argument 123 pc = (br_ssl_server_policy_rsa_context *)pctx; in sr_do_sign()
|
H A D | ssl_scert_single_ec.c | 28 se_choose(const br_ssl_server_policy_class **pctx, in se_choose() argument 37 pc = (br_ssl_server_policy_ec_context *)pctx; in se_choose() 81 se_do_keyx(const br_ssl_server_policy_class **pctx, in se_do_keyx() argument 88 pc = (br_ssl_server_policy_ec_context *)pctx; in se_do_keyx() 97 se_do_sign(const br_ssl_server_policy_class **pctx, in se_do_sign() argument 105 pc = (br_ssl_server_policy_ec_context *)pctx; in se_do_sign()
|
/freebsd/contrib/libfido2/src/ |
H A D | rs1.c | 66 EVP_PKEY_CTX *pctx = NULL; in rs1_verify_sig() local 80 if ((pctx = EVP_PKEY_CTX_new(pkey, NULL)) == NULL || in rs1_verify_sig() 81 EVP_PKEY_verify_init(pctx) != 1 || in rs1_verify_sig() 82 EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PADDING) != 1 || in rs1_verify_sig() 83 EVP_PKEY_CTX_set_signature_md(pctx, md) != 1) { in rs1_verify_sig() 88 if (EVP_PKEY_verify(pctx, sig->ptr, sig->len, dgst->ptr, in rs1_verify_sig() 96 EVP_PKEY_CTX_free(pctx); in rs1_verify_sig()
|
H A D | es256.c | 223 EVP_PKEY_CTX *pctx = NULL; in es256_sk_create() local 232 if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) == NULL || in es256_sk_create() 233 EVP_PKEY_paramgen_init(pctx) <= 0 || in es256_sk_create() 234 EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, es256_nid) <= 0 || in es256_sk_create() 235 EVP_PKEY_paramgen(pctx, &p) <= 0) { in es256_sk_create() 260 if (pctx != NULL) in es256_sk_create() 261 EVP_PKEY_CTX_free(pctx); in es256_sk_create() 500 EVP_PKEY_CTX *pctx = NULL; in es256_verify_sig() local 508 if ((pctx = EVP_PKEY_CTX_new(pkey, NULL)) == NULL || in es256_verify_sig() 509 EVP_PKEY_verify_init(pctx) != 1 || in es256_verify_sig() [all …]
|
/freebsd/crypto/openssl/doc/man3/ |
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_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_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); 18 int EVP_PKEY_CTX_set1_hkdf_salt(EVP_PKEY_CTX *pctx, unsigned char *salt, 21 int EVP_PKEY_CTX_set1_hkdf_key(EVP_PKEY_CTX *pctx, unsigned char *key, 24 int EVP_PKEY_CTX_add1_hkdf_info(EVP_PKEY_CTX *pctx, unsigned char *info, 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) [all …]
|
/freebsd/lib/libnetmap/ |
H A D | nmreq.c | 411 struct nmreq_parse_ctx *pctx) in nmreq_option_parsekeys() argument 438 nmctx_ferror(pctx->ctx, "unknown key: '%s'", key); in nmreq_option_parsekeys() 442 if (pctx->keys[k->id] != NULL) { in nmreq_option_parsekeys() 443 nmctx_ferror(pctx->ctx, "option '%s': duplicate key '%s', already set to '%s'", in nmreq_option_parsekeys() 444 prefix, key, pctx->keys[k->id]); in nmreq_option_parsekeys() 456 pctx->keys[k->id] = (vlen ? value : NULL); in nmreq_option_parsekeys() 459 nmctx_ferror(pctx->ctx, "option '%s': missing '=value' for key '%s'", in nmreq_option_parsekeys() 464 pctx->keys[k->id] = key; in nmreq_option_parsekeys() 469 if ((k->flags & NMREQ_OPTK_MUSTSET) && pctx->keys[k->id] == NULL) { in nmreq_option_parsekeys() 470 nmctx_ferror(pctx->ctx, "option '%s': mandatory key '%s' not assigned", in nmreq_option_parsekeys() [all …]
|
/freebsd/crypto/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);
|
/freebsd/crypto/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()
|