Home
last modified time | relevance | path

Searched refs:priv_key (Results 1 – 25 of 68) sorted by relevance

123

/freebsd/crypto/openssl/crypto/dsa/
H A Ddsa_key.c51 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dsa_generate_public_key()
66 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_keygen() local
71 if (dsa->priv_key == NULL) { in dsa_keygen()
72 if ((priv_key = BN_secure_new()) == NULL) in dsa_keygen()
75 priv_key = dsa->priv_key; in dsa_keygen()
90 MIN_STRENGTH, priv_key)) in dsa_keygen()
103 dsa->priv_key = priv_key; in dsa_keygen()
120 BN_clear_free(dsa->priv_key); in dsa_keygen()
122 dsa->priv_key = NULL; in dsa_keygen()
132 if (priv_key != dsa->priv_key) in dsa_keygen()
[all …]
H A Ddsa_lib.c64 if (r->priv_key != NULL) { in DSA_dup_DH()
65 priv_key = BN_dup(r->priv_key); in DSA_dup_DH()
66 if (priv_key == NULL) in DSA_dup_DH()
80 BN_free(priv_key); in DSA_dup_DH()
237 BN_clear_free(r->priv_key); in DSA_free()
302 return d->priv_key; in DSA_get0_priv_key()
310 if (priv_key != NULL) in DSA_get0_key()
311 *priv_key = d->priv_key; in DSA_get0_key()
320 if (priv_key != NULL) { in DSA_set0_key()
321 BN_free(d->priv_key); in DSA_set0_key()
[all …]
H A Ddsa_backend.c34 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dsa_key_fromdata() local
52 if (param_priv_key != NULL && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dsa_key_fromdata()
55 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_dsa_key_fromdata()
61 BN_clear_free(priv_key); in ossl_dsa_key_fromdata()
106 || !dsa_bn_dup_check(&dupkey->priv_key, dsa->priv_key))) in ossl_dsa_dup()
H A Ddsa_check.c57 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) in ossl_dsa_check_priv_key() argument
62 && ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret)); in ossl_dsa_check_priv_key()
77 || dsa->priv_key == NULL in ossl_dsa_check_pairwise()
89 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) in ossl_dsa_check_pairwise()
H A Ddsa_ameth.c170 if (pkey->pkey.dsa == NULL|| pkey->pkey.dsa->priv_key == NULL) { in dsa_priv_encode()
190 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL); in dsa_priv_encode()
276 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
283 priv_key = x->priv_key; in do_dsa_print()
285 priv_key = NULL; in do_dsa_print()
299 if (priv_key != NULL) { in do_dsa_print()
309 if (!ASN1_bn_print(bp, "priv:", priv_key, NULL, off)) in do_dsa_print()
437 const BIGNUM *priv_key = DSA_get0_priv_key(dsa); in dsa_pkey_export_to() local
460 if (priv_key != NULL) { in dsa_pkey_export_to()
462 priv_key)) in dsa_pkey_export_to()
/freebsd/crypto/openssl/crypto/ec/
H A Dec_key.c99 BN_clear_free(r->priv_key); in EC_KEY_free()
150 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
254 BIGNUM *priv_key = NULL; in ec_generate_key() local
267 if (priv_key == NULL) in ec_generate_key()
270 priv_key = eckey->priv_key; in ec_generate_key()
318 eckey->priv_key = priv_key; in ec_generate_key()
320 priv_key = NULL; in ec_generate_key()
347 BN_clear_free(priv_key); in ec_generate_key()
692 return key->priv_key; in EC_KEY_get0_private_key()
727 if (priv_key == NULL) { in EC_KEY_set_private_key()
[all …]
H A Decdh_ossl.c55 const BIGNUM *priv_key; in ossl_ecdh_simple_compute_key() local
70 priv_key = EC_KEY_get0_private_key(ecdh); in ossl_ecdh_simple_compute_key()
71 if (priv_key == NULL) { in ossl_ecdh_simple_compute_key()
84 !BN_mul(x, x, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
88 priv_key = x; in ossl_ecdh_simple_compute_key()
96 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ossl_ecdh_simple_compute_key()
H A Dec_asn1.c940 EC_PRIVATEKEY *priv_key = NULL; in d2i_ECPrivateKey() local
954 if (priv_key->parameters) { in d2i_ECPrivateKey()
967 ret->version = priv_key->version; in d2i_ECPrivateKey()
969 if (priv_key->privateKey) { in d2i_ECPrivateKey()
989 if (priv_key->publicKey) { in d2i_ECPrivateKey()
1009 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey()
1017 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey()
1027 EC_PRIVATEKEY *priv_key = NULL; in i2d_ECPrivateKey() local
1040 priv_key->version = a->version; in i2d_ECPrivateKey()
1053 if ((priv_key->parameters = in i2d_ECPrivateKey()
[all …]
H A Dec_backend.c400 BIGNUM *priv_key = NULL; in ossl_ec_key_fromdata() local
471 if ((priv_key = BN_secure_new()) == NULL) in ossl_ec_key_fromdata()
473 if (bn_wexpand(priv_key, fixed_words) == NULL) in ossl_ec_key_fromdata()
475 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in ossl_ec_key_fromdata()
477 if (!OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_ec_key_fromdata()
481 if (priv_key != NULL in ossl_ec_key_fromdata()
482 && !EC_KEY_set_private_key(ec, priv_key)) in ossl_ec_key_fromdata()
493 BN_clear_free(priv_key); in ossl_ec_key_fromdata()
642 if (src->priv_key != NULL in ossl_ec_key_dup()
647 ret->priv_key = BN_new(); in ossl_ec_key_dup()
[all …]
/freebsd/crypto/openssl/providers/implementations/keymgmt/
H A Dmac_legacy_kmgmt.c59 unsigned char *priv_key; member
167 if ((key1->priv_key == NULL && key2->priv_key != NULL) in mac_match()
168 || (key1->priv_key != NULL && key2->priv_key == NULL) in mac_match()
175 || CRYPTO_memcmp(key1->priv_key, key2->priv_key, in mac_match()
197 if (key->priv_key == NULL) { in mac_key_fromdata()
225 if (key->priv_key != NULL) in mac_key_fromdata()
250 if (key->priv_key != NULL in key_to_params()
435 if (gctx->priv_key == NULL) { in mac_gen_set_params()
500 if (gctx->priv_key == NULL) { in mac_gen()
518 key->priv_key = gctx->priv_key; in mac_gen()
[all …]
/freebsd/crypto/openssl/crypto/dh/
H A Ddh_key.c72 if (dh->priv_key == NULL) { in ossl_dh_compute_key()
80 BN_set_flags(dh->priv_key, BN_FLG_CONSTTIME); in ossl_dh_compute_key()
249 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dh_generate_public_key()
269 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local
291 if (dh->priv_key == NULL) { in generate_key()
292 priv_key = BN_secure_new(); in generate_key()
293 if (priv_key == NULL) in generate_key()
297 priv_key = dh->priv_key; in generate_key()
369 dh->priv_key = priv_key; in generate_key()
378 if (priv_key != dh->priv_key) in generate_key()
[all …]
H A Ddh_lib.c159 BN_clear_free(r->priv_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
259 if (priv_key != NULL) in DH_get0_key()
260 *priv_key = dh->priv_key; in DH_get0_key()
263 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
269 if (priv_key != NULL) { in DH_set0_key()
270 BN_clear_free(dh->priv_key); in DH_set0_key()
271 dh->priv_key = priv_key; in DH_set0_key()
295 return dh->priv_key; in DH_get0_priv_key()
H A Ddh_backend.c69 BIGNUM *priv_key = NULL, *pub_key = NULL; in ossl_dh_key_fromdata() local
79 && !OSSL_PARAM_get_BN(param_priv_key, &priv_key)) in ossl_dh_key_fromdata()
86 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata()
92 BN_clear_free(priv_key); in ossl_dh_key_fromdata()
170 || !dh_bn_dup_check(&dupkey->priv_key, dh->priv_key))) in ossl_dh_dup()
H A Ddh_check.c278 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret) in ossl_dh_check_priv_key() argument
300 if (BN_num_bits(priv_key) <= length in ossl_dh_check_priv_key()
301 && BN_num_bits(priv_key) > 1) in ossl_dh_check_priv_key()
303 } else if (BN_num_bits(priv_key) == length) { in ossl_dh_check_priv_key()
319 if (!ossl_ffc_validate_private_key(upper, priv_key, ret)) in ossl_dh_check_priv_key()
340 || dh->priv_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()
H A Ddh_ameth.c199 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL); in dh_priv_encode()
248 BIGNUM *priv_key, *pub_key; in do_dh_print() local
251 priv_key = x->priv_key; in do_dh_print()
253 priv_key = NULL; in do_dh_print()
260 if (x->params.p == NULL || (ptype == 2 && priv_key == NULL) in do_dh_print()
278 if (!ASN1_bn_print(bp, "private-key:", priv_key, NULL, indent)) in do_dh_print()
461 const BIGNUM *priv_key = DH_get0_priv_key(dh); in dh_pkey_export_to() local
490 if (priv_key != NULL) { in dh_pkey_export_to()
492 priv_key)) in dh_pkey_export_to()
/freebsd/crypto/openssl/crypto/sm2/
H A Dsm2_key.c27 const BIGNUM *priv_key = NULL, *order = NULL; in ossl_sm2_key_private_check() local
31 || (priv_key = EC_KEY_get0_private_key(eckey)) == NULL in ossl_sm2_key_private_check()
41 if (BN_cmp(priv_key, BN_value_one()) < 0 in ossl_sm2_key_private_check()
42 || BN_cmp(priv_key, max) >= 0) { in ossl_sm2_key_private_check()
/freebsd/crypto/openssl/apps/
H A Dtestdsa.h219 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
242 priv_key = BN_bin2bn(dsa_t.priv, dsa_t.priv_l, NULL); in get_dsa()
247 if (priv_key == NULL || pub_key == NULL || p == NULL || q == NULL in get_dsa()
259 priv_key) in get_dsa()
272 BN_free(priv_key); in get_dsa()
/freebsd/crypto/openssl/demos/signature/
H A DEVP_Signature_demo.c78 EVP_PKEY *priv_key = NULL; in demo_sign() local
81 priv_key = get_key(libctx, propq, public); in demo_sign()
82 if (priv_key == NULL) { in demo_sign()
100 libctx, NULL, priv_key, NULL)) { in demo_sign()
145 EVP_PKEY_free(priv_key); in demo_sign()
/freebsd/crypto/openssl/test/
H A Ddhtest.c42 BIGNUM *priv_key = NULL; in dh_test() local
61 || !TEST_ptr(priv_key = BN_new())) in dh_test()
105 if (!TEST_true(BN_set_word(priv_key, 1234L)) in dh_test()
106 || !TEST_true(DH_set0_key(dh, NULL, priv_key))) in dh_test()
112 || !TEST_ptr_eq(priv_key2, priv_key)) in dh_test()
239 BN_free(priv_key); in dh_test()
586 BIGNUM *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local
598 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test()
603 || !TEST_true( DH_set0_key(dhB, pub_key, priv_key))) in rfc5114_test()
605 priv_key = pub_key = NULL; in rfc5114_test()
[all …]
/freebsd/crypto/openssl/providers/implementations/encode_decode/
H A Dencode_key2text.c220 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dh_to_text() local
238 priv_key = DH_get0_priv_key(dh); in dh_to_text()
239 if (priv_key == NULL) { in dh_to_text()
267 if (priv_key != NULL in dh_to_text()
296 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dsa_to_text() local
313 priv_key = DSA_get0_priv_key(dsa); in dsa_to_text()
314 if (priv_key == NULL) { in dsa_to_text()
342 if (priv_key != NULL in dsa_to_text()
343 && !print_labeled_bignum(out, "priv:", priv_key)) in dsa_to_text()
518 const BIGNUM *priv_key = EC_KEY_get0_private_key(ec); in ec_to_text() local
[all …]
/freebsd/contrib/wpa/src/common/
H A Ddpp_backup.c37 struct wpabuf *buf, *priv_key = NULL; in dpp_build_conf_params() local
47 if (!priv_key) in dpp_build_conf_params()
53 if (priv_key) in dpp_build_conf_params()
54 len += wpabuf_len(priv_key); in dpp_build_conf_params()
67 asn1_put_octet_string(buf, priv_key); in dpp_build_conf_params()
72 wpabuf_clear_free(priv_key); in dpp_build_conf_params()
75 wpabuf_clear_free(priv_key); in dpp_build_conf_params()
156 if (!priv_key) in dpp_build_key_pkg()
164 if (!priv_key || !attr || !alg) in dpp_build_key_pkg()
190 asn1_put_octet_string(key, priv_key); in dpp_build_key_pkg()
[all …]
/freebsd/contrib/bsnmp/lib/
H A Dsnmpcrypto.c157 piv[i] = piv[i] ^ pdu->user.priv_key[8 + i]; in snmp_pdu_cipher_init()
194 if (EVP_EncryptInit(ctx, ctype, pdu->user.priv_key, iv) != 1) in snmp_pdu_encrypt()
227 if (EVP_DecryptInit(ctx, ctype, pdu->user.priv_key, iv) != 1 || in snmp_pdu_decrypt()
307 memset(user->priv_key, 0, sizeof(user->priv_key)); in snmp_get_local_keys()
330 memcpy(user->priv_key, user->auth_key, sizeof(user->priv_key)); in snmp_get_local_keys()
/freebsd/contrib/bsnmp/snmp_usm/
H A Dusm_snmp.c203 memcpy(uuser->suser.priv_key, clone->suser.priv_key, in op_usm_users()
204 sizeof(uuser->suser.priv_key)); in op_usm_users()
268 memcpy(ctx->scratch->ptr1, uuser->suser.priv_key, in op_usm_users()
269 sizeof(uuser->suser.priv_key)); in op_usm_users()
270 memcpy(uuser->suser.priv_key, val->v.octetstring.octets, in op_usm_users()
366 memcpy(uuser->suser.priv_key, ctx->scratch->ptr1, in op_usm_users()
367 sizeof(uuser->suser.priv_key)); in op_usm_users()
439 return (string_get(val, (char *)uuser->suser.priv_key, 0)); in op_usm_users()
/freebsd/contrib/ntp/libntp/
H A Dlibssl_compat.c305 *ppriv_key = pdsa->priv_key; in sslshim_DSA_get0_key()
312 BIGNUM * priv_key in sslshim_DSA_set0_key() argument
320 replace_bn_nn(&pdsa->priv_key, priv_key); in sslshim_DSA_set0_key()
/freebsd/crypto/openssh/regress/unittests/sshkey/
H A Dcommon.c155 const BIGNUM *priv_key = NULL; in dsa_priv_key() local
159 DSA_get0_key(k->dsa, NULL, &priv_key); in dsa_priv_key()
160 return priv_key; in dsa_priv_key()

123