| /freebsd-14.2/crypto/openssl/crypto/dsa/ |
| H A D | dsa_key.c | 54 if (!BN_mod_exp(pub_key, dsa->params.g, prk, dsa->params.p, ctx)) in ossl_dsa_generate_public_key() 66 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_keygen() local 93 if (dsa->pub_key == NULL) { in dsa_keygen() 94 if ((pub_key = BN_new()) == NULL) in dsa_keygen() 97 pub_key = dsa->pub_key; in dsa_keygen() 100 if (!ossl_dsa_generate_public_key(ctx, dsa, priv_key, pub_key)) in dsa_keygen() 104 dsa->pub_key = pub_key; in dsa_keygen() 119 BN_free(dsa->pub_key); in dsa_keygen() 121 dsa->pub_key = NULL; in dsa_keygen() 130 if (pub_key != dsa->pub_key) in dsa_keygen() [all …]
|
| H A D | dsa_check.c | 66 int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) in ossl_dsa_check_pub_key() argument 71 return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret) in ossl_dsa_check_pub_key() 80 int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) in ossl_dsa_check_pub_key_partial() argument 85 return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret) in ossl_dsa_check_pub_key_partial() 107 BIGNUM *pub_key = NULL; in ossl_dsa_check_pairwise() local 114 || dsa->pub_key == NULL) in ossl_dsa_check_pairwise() 120 pub_key = BN_new(); in ossl_dsa_check_pairwise() 121 if (pub_key == NULL) in ossl_dsa_check_pairwise() 125 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) in ossl_dsa_check_pairwise() 128 ret = BN_cmp(pub_key, dsa->pub_key) == 0; in ossl_dsa_check_pairwise() [all …]
|
| H A D | dsa_lib.c | 60 if (r->pub_key != NULL) { in DSA_dup_DH() 61 pub_key = BN_dup(r->pub_key); in DSA_dup_DH() 62 if (pub_key == NULL) in DSA_dup_DH() 79 BN_free(pub_key); in DSA_dup_DH() 236 BN_clear_free(r->pub_key); in DSA_free() 297 return d->pub_key; in DSA_get0_pub_key() 308 if (pub_key != NULL) in DSA_get0_key() 309 *pub_key = d->pub_key; in DSA_get0_key() 316 if (pub_key != NULL) { in DSA_set0_key() 317 BN_free(d->pub_key); in DSA_set0_key() [all …]
|
| H A D | dsa_backend.c | 34 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dsa_key_fromdata() local 50 if (param_pub_key != NULL && !OSSL_PARAM_get_BN(param_pub_key, &pub_key)) in ossl_dsa_key_fromdata() 55 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_dsa_key_fromdata() 62 BN_free(pub_key); in ossl_dsa_key_fromdata() 101 || !dsa_bn_dup_check(&dupkey->pub_key, dsa->pub_key))) in ossl_dsa_dup()
|
| H A D | dsa_ameth.c | 70 if ((dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dsa_pub_decode() 116 pubint = BN_to_ASN1_INTEGER(dsa->pub_key, NULL); in dsa_pub_encode() 264 return BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) == 0; in dsa_pub_cmp() 276 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local 288 pub_key = x->pub_key; in do_dsa_print() 290 pub_key = NULL; in do_dsa_print() 311 if (!ASN1_bn_print(bp, "pub: ", pub_key, NULL, off)) in do_dsa_print() 436 const BIGNUM *q = DSA_get0_q(dsa), *pub_key = DSA_get0_pub_key(dsa); in dsa_pkey_export_to() local 454 if (pub_key != NULL) { in dsa_pkey_export_to() 456 pub_key)) in dsa_pkey_export_to()
|
| /freebsd-14.2/crypto/openssl/crypto/ec/ |
| H A D | ec_key.c | 98 EC_POINT_free(r->pub_key); in EC_KEY_free() 140 if (!EC_POINT_copy(dest->pub_key, src->pub_key)) in EC_KEY_copy() 257 EC_POINT *pub_key = NULL; in ec_generate_key() local 309 if (pub_key == NULL) in ec_generate_key() 312 pub_key = eckey->pub_key; in ec_generate_key() 319 eckey->pub_key = pub_key; in ec_generate_key() 321 pub_key = NULL; in ec_generate_key() 346 EC_POINT_free(pub_key); in ec_generate_key() 792 return key->pub_key; in EC_KEY_get0_public_key() 801 key->pub_key = EC_POINT_dup(pub_key, key->group); in EC_KEY_set_public_key() [all …]
|
| H A D | ecdh_ossl.c | 29 const EC_POINT *pub_key, const EC_KEY *ecdh) in ossl_ecdh_compute_key() argument 36 return ecdh->group->meth->ecdh_compute_key(psec, pseclen, pub_key, ecdh); in ossl_ecdh_compute_key() 50 const EC_POINT *pub_key, const EC_KEY *ecdh) in ossl_ecdh_simple_compute_key() argument 96 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
|
| H A D | ec_kmeth.c | 154 int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, in ECDH_compute_key() argument 169 if (!eckey->meth->compute_key(&sec, &seclen, pub_key, eckey)) in ECDH_compute_key() 208 const EC_POINT *pub_key)) in EC_KEY_METHOD_set_init() argument 227 const EC_POINT *pub_key, in EC_KEY_METHOD_set_compute_key() argument 275 const EC_POINT *pub_key)) in EC_KEY_METHOD_get_init() argument 301 const EC_POINT *pub_key, in EC_KEY_METHOD_get_compute_key() argument
|
| /freebsd-14.2/crypto/openssl/crypto/dh/ |
| H A D | dh_key.c | 121 ret = ossl_dh_compute_key(key, pub_key, dh); in DH_compute_key() 150 rv = ossl_dh_compute_key(key, pub_key, dh); in DH_compute_key_padded() 152 rv = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key_padded() 269 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local 300 if (dh->pub_key == NULL) { in generate_key() 301 pub_key = BN_new(); in generate_key() 302 if (pub_key == NULL) in generate_key() 305 pub_key = dh->pub_key; in generate_key() 368 dh->pub_key = pub_key; in generate_key() 376 if (pub_key != dh->pub_key) in generate_key() [all …]
|
| H A D | dh_check.c | 230 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) in DH_check_pub_key_ex() argument 234 if (!DH_check_pub_key(dh, pub_key, &errflags)) in DH_check_pub_key_ex() 250 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) in DH_check_pub_key() argument 264 return ossl_ffc_validate_public_key(&dh->params, pub_key, ret); in DH_check_pub_key() 336 BIGNUM *pub_key = NULL; in ossl_dh_check_pairwise() local 341 || dh->pub_key == NULL) in ossl_dh_check_pairwise() 347 pub_key = BN_new(); in ossl_dh_check_pairwise() 348 if (pub_key == NULL) in ossl_dh_check_pairwise() 352 if (!ossl_dh_generate_public_key(ctx, dh, dh->priv_key, pub_key)) in ossl_dh_check_pairwise() 355 ret = BN_cmp(pub_key, dh->pub_key) == 0; in ossl_dh_check_pairwise() [all …]
|
| H A D | dh_ameth.c | 118 ASN1_INTEGER *pub_key = NULL; in dh_pub_encode() local 134 pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL); in dh_pub_encode() 135 if (pub_key == NULL) in dh_pub_encode() 138 penclen = i2d_ASN1_INTEGER(pub_key, &penc); in dh_pub_encode() 140 ASN1_INTEGER_free(pub_key); in dh_pub_encode() 248 BIGNUM *priv_key, *pub_key; in do_dh_print() local 256 pub_key = x->pub_key; in do_dh_print() 258 pub_key = NULL; in do_dh_print() 368 if (BN_cmp(b->pkey.dh->pub_key, a->pkey.dh->pub_key) != 0) in dh_pub_cmp() 432 if (dh->pub_key == NULL) { in dh_pkey_public_check() [all …]
|
| H A D | dh_lib.c | 158 BN_clear_free(r->pub_key); in DH_free() 255 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument 257 if (pub_key != NULL) in DH_get0_key() 258 *pub_key = dh->pub_key; in DH_get0_key() 263 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument 265 if (pub_key != NULL) { in DH_set0_key() 266 BN_clear_free(dh->pub_key); in DH_set0_key() 267 dh->pub_key = pub_key; in DH_set0_key() 300 return dh->pub_key; in DH_get0_pub_key()
|
| H A D | dh_backend.c | 69 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dh_key_fromdata() local 83 && !OSSL_PARAM_get_BN(param_pub_key, &pub_key)) in ossl_dh_key_fromdata() 86 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata() 93 BN_free(pub_key); in ossl_dh_key_fromdata() 165 || !dh_bn_dup_check(&dupkey->pub_key, dh->pub_key))) in ossl_dh_dup()
|
| /freebsd-14.2/crypto/openssl/util/perl/TLSProxy/ |
| H A D | ServerKeyExchange.pm | 35 $self->{pub_key} = ""; 65 my $pub_key = substr($self->data, $ptr, $pub_key_len); 88 $self->pub_key($pub_key); 104 $data .= pack('n', length($self->pub_key)); 105 $data .= $self->pub_key; 133 sub pub_key subroutine 137 $self->{pub_key} = shift; 139 return $self->{pub_key};
|
| /freebsd-14.2/crypto/openssl/crypto/ffc/ |
| H A D | ffc_key_validate.c | 20 const BIGNUM *pub_key, int *ret) in ossl_ffc_validate_public_key_partial() argument 27 if (params == NULL || pub_key == NULL || params->p == NULL) { in ossl_ffc_validate_public_key_partial() 42 if (BN_cmp(pub_key, tmp) <= 0) in ossl_ffc_validate_public_key_partial() 48 if (BN_cmp(pub_key, tmp) >= 0) in ossl_ffc_validate_public_key_partial() 63 const BIGNUM *pub_key, int *ret) in ossl_ffc_validate_public_key() argument 69 if (!ossl_ffc_validate_public_key_partial(params, pub_key, ret)) in ossl_ffc_validate_public_key() 81 || !BN_mod_exp(tmp, pub_key, params->q, params->p, ctx)) in ossl_ffc_validate_public_key()
|
| /freebsd-14.2/crypto/openssh/ |
| H A D | kexdh.c | 117 const BIGNUM *pub_key; in kex_dh_keypair() local 123 DH_get0_key(kex->dh, &pub_key, NULL); in kex_dh_keypair() 126 if ((r = sshbuf_put_bignum2(buf, pub_key)) != 0 || in kex_dh_keypair() 132 BN_print_fp(stderr, pub_key); in kex_dh_keypair() 146 const BIGNUM *pub_key; in kex_dh_enc() local 155 DH_get0_key(kex->dh, &pub_key, NULL); in kex_dh_enc() 160 if ((r = sshbuf_put_bignum2(server_blob, pub_key)) != 0 || in kex_dh_enc()
|
| H A D | kexgexc.c | 99 const BIGNUM *pub_key; in input_kex_dh_gex_group() local 123 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_group() 125 (r = sshpkt_put_bignum2(ssh, pub_key)) != 0 || in input_kex_dh_gex_group() 132 BN_print_fp(stderr, pub_key); in input_kex_dh_gex_group() 149 const BIGNUM *pub_key, *dh_p, *dh_g; in input_kex_dh_gex_reply() local 187 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_reply() 199 pub_key, in input_kex_dh_gex_reply()
|
| /freebsd-14.2/crypto/openssl/apps/ |
| H A D | testdsa.h | 219 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local 243 pub_key = BN_bin2bn(dsa_t.pub, dsa_t.pub_l, NULL); in get_dsa() 247 if (priv_key == NULL || pub_key == NULL || p == NULL || q == NULL in get_dsa() 261 pub_key) in get_dsa() 273 BN_free(pub_key); in get_dsa()
|
| /freebsd-14.2/contrib/ntp/libntp/ |
| H A D | libssl_compat.c | 303 *ppub_key = pdsa->pub_key; in sslshim_DSA_get0_key() 311 BIGNUM * pub_key, in sslshim_DSA_set0_key() argument 316 if (!(pdsa->pub_key || pub_key)) in sslshim_DSA_set0_key() 319 replace_bn_nn(&pdsa->pub_key, pub_key); in sslshim_DSA_set0_key()
|
| /freebsd-14.2/crypto/openssl/demos/signature/ |
| H A D | EVP_Signature_demo.c | 156 EVP_PKEY *pub_key = NULL; in demo_verify() local 168 pub_key = get_key(libctx, propq, public); in demo_verify() 169 if (pub_key == NULL) { in demo_verify() 175 libctx, NULL, pub_key, NULL)) { in demo_verify() 200 EVP_PKEY_free(pub_key); in demo_verify()
|
| /freebsd-14.2/crypto/openssl/include/openssl/ |
| H A D | dh.h | 222 OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key); 225 OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, 229 const BIGNUM *pub_key, DH *dh); 231 const BIGNUM *pub_key, DH *dh); 260 OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, 262 OSSL_DEPRECATEDIN_3_0 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); 289 const BIGNUM *pub_key, 294 const BIGNUM *pub_key,
|
| /freebsd-14.2/crypto/openssl/include/crypto/ |
| H A D | dsa.h | 39 const BIGNUM *priv_key, BIGNUM *pub_key); 41 int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret); 42 int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key,
|
| H A D | dh.h | 25 const BIGNUM *priv_key, BIGNUM *pub_key); 41 int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); 43 int ossl_dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret);
|
| /freebsd-14.2/contrib/ldns/ |
| H A D | keys.c | 234 EC_POINT* pub_key; in ldns_EC_KEY_calc_public() local 237 pub_key = EC_POINT_new(group); in ldns_EC_KEY_calc_public() 238 if(!pub_key) return 0; in ldns_EC_KEY_calc_public() 240 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public() 252 EC_POINT_free(pub_key); in ldns_EC_KEY_calc_public() 980 if (!pub_key) { in ldns_key_new_frm_fp_dsa_l() 991 dsa->pub_key = pub_key; in ldns_key_new_frm_fp_dsa_l() 1016 BN_free(pub_key); in ldns_key_new_frm_fp_dsa_l() 1699 const BIGNUM *pub_key, *priv_key; in ldns_key_dsa2bin() local 1714 pub_key = k->pub_key; priv_key = k->priv_key; in ldns_key_dsa2bin() [all …]
|
| /freebsd-14.2/crypto/openssl/crypto/pem/ |
| H A D | pvkfmt.c | 380 BIGNUM *pub_key = NULL; in ossl_b2i_DSA_after_header() local 396 if (!read_lebn(&p, nbyte, &pub_key)) in ossl_b2i_DSA_after_header() 406 pub_key = BN_new(); in ossl_b2i_DSA_after_header() 407 if (pub_key == NULL) in ossl_b2i_DSA_after_header() 421 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_b2i_DSA_after_header() 423 pub_key = priv_key = NULL; in ossl_b2i_DSA_after_header() 434 BN_free(pub_key); in ossl_b2i_DSA_after_header() 694 DSA_get0_key(dsa, &pub_key, &priv_key); in check_bitlen_dsa() 700 if (BN_num_bits(pub_key) > bitlen) in check_bitlen_dsa() 722 DSA_get0_key(dsa, &pub_key, &priv_key); in write_dsa() [all …]
|