Home
last modified time | relevance | path

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

12

/dragonfly/crypto/libressl/crypto/dsa/
H A Ddsa_key.c87 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_builtin_keygen() local
92 if ((priv_key = dsa->priv_key) == NULL) { in dsa_builtin_keygen()
93 if ((priv_key = BN_new()) == NULL) in dsa_builtin_keygen()
97 if (!bn_rand_interval(priv_key, BN_value_one(), dsa->q)) in dsa_builtin_keygen()
105 if (!BN_mod_exp_ct(pub_key, dsa->g, priv_key, dsa->p, ctx)) in dsa_builtin_keygen()
108 dsa->priv_key = priv_key; in dsa_builtin_keygen()
115 if (dsa->priv_key == NULL) in dsa_builtin_keygen()
116 BN_free(priv_key); in dsa_builtin_keygen()
H A Ddsa_lib.c162 ret->priv_key = NULL; in DSA_new_method()
207 BN_clear_free(r->priv_key); in DSA_free()
294 if (r->priv_key != NULL) in DSA_dup_DH()
295 if ((ret->priv_key = BN_dup(r->priv_key)) == NULL) in DSA_dup_DH()
345 if (priv_key != NULL) in DSA_get0_key()
346 *priv_key = d->priv_key; in DSA_get0_key()
350 DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) in DSA_set0_key() argument
359 if (priv_key != NULL) { in DSA_set0_key()
360 BN_free(d->priv_key); in DSA_set0_key()
361 d->priv_key = priv_key; in DSA_set0_key()
[all …]
H A Ddsa_ameth.c215 if (!(dsa->priv_key = ASN1_INTEGER_to_BN(privkey, NULL))) { in dsa_priv_decode()
229 if (!BN_mod_exp_ct(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { in dsa_priv_decode()
272 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL); in dsa_priv_encode()
391 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
394 priv_key = x->priv_key; in do_dsa_print()
396 priv_key = NULL; in do_dsa_print()
413 update_buflen(priv_key, &buf_len); in do_dsa_print()
422 if (priv_key) { in do_dsa_print()
430 if (!ASN1_bn_print(bp, "priv:", priv_key, m, off)) in do_dsa_print()
/dragonfly/crypto/libressl/crypto/ec/
H A Dec_key.c123 BN_clear_free(r->priv_key); in EC_KEY_free()
169 if (src->priv_key) { in EC_KEY_copy()
171 dest->priv_key = BN_new(); in EC_KEY_copy()
175 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
277 if ((priv_key = eckey->priv_key) == NULL) { in ossl_ec_key_gen()
296 eckey->priv_key = priv_key; in ossl_ec_key_gen()
305 if (eckey->priv_key == NULL) in ossl_ec_key_gen()
306 BN_free(priv_key); in ossl_ec_key_gen()
355 if (eckey->priv_key) { in EC_KEY_check_key()
451 return key->priv_key; in EC_KEY_get0_private_key()
[all …]
H A Dec_asn1.c1349 if (priv_key->parameters) { in d2i_ECPrivateKey()
1359 if (priv_key->privateKey) { in d2i_ECPrivateKey()
1360 ret->priv_key = BN_bin2bn( in d2i_ECPrivateKey()
1363 ret->priv_key); in d2i_ECPrivateKey()
1364 if (ret->priv_key == NULL) { in d2i_ECPrivateKey()
1381 if (priv_key->publicKey) { in d2i_ECPrivateKey()
1409 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey()
1417 if (priv_key) in d2i_ECPrivateKey()
1418 EC_PRIVATEKEY_free(priv_key); in d2i_ECPrivateKey()
1502 if (priv_key) in i2d_ECPrivateKey()
[all …]
H A Dec_ameth.c266 const BIGNUM *priv_key; in eckey_priv_decode() local
284 priv_key = EC_KEY_get0_private_key(eckey); in eckey_priv_decode()
285 if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, NULL)) { in eckey_priv_decode()
449 const BIGNUM *priv_key; in do_EC_KEY_print() local
473 priv_key = EC_KEY_get0_private_key(x); in do_EC_KEY_print()
474 if (priv_key && (i = (size_t) BN_num_bytes(priv_key)) > buf_len) in do_EC_KEY_print()
477 priv_key = NULL; in do_EC_KEY_print()
503 if ((priv_key != NULL) && !ASN1_bn_print(bp, "priv:", priv_key, in do_EC_KEY_print()
648 if (eckey->priv_key == NULL) { in ec_pkey_check()
H A Dec_kmeth.c167 ret->priv_key = NULL; in EC_KEY_new_method()
213 int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), in EC_KEY_METHOD_set_init() argument
272 int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), in EC_KEY_METHOD_get_init() argument
/dragonfly/crypto/libressl/crypto/dh/
H A Ddh_key.c109 BIGNUM *pub_key = NULL, *priv_key = NULL, *two = NULL; in generate_key() local
120 if ((priv_key = dh->priv_key) == NULL) { in generate_key()
121 if ((priv_key = BN_new()) == NULL) in generate_key()
137 if (dh->priv_key == NULL) { in generate_key()
143 if (!bn_rand_interval(priv_key, two, dh->q)) in generate_key()
148 if (!BN_rand(priv_key, l, 0, 0)) in generate_key()
158 dh->priv_key = priv_key; in generate_key()
166 if (dh->priv_key == NULL) in generate_key()
167 BN_free(priv_key); in generate_key()
194 if (dh->priv_key == NULL) { in compute_key()
[all …]
H A Ddh_lib.c157 ret->priv_key = NULL; in DH_new_method()
204 BN_clear_free(r->priv_key); in DH_free()
302 DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
306 if (priv_key != NULL) in DH_get0_key()
307 *priv_key = dh->priv_key; in DH_get0_key()
311 DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
317 if (priv_key != NULL) { in DH_set0_key()
318 BN_free(dh->priv_key); in DH_set0_key()
319 dh->priv_key = priv_key; in DH_set0_key()
346 return dh->priv_key; in DH_get0_priv_key()
H A Ddh_ameth.c213 if (!(dh->priv_key = ASN1_INTEGER_to_BN(privkey, NULL))) { in dh_priv_decode()
258 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL); in dh_priv_encode()
320 BIGNUM *priv_key, *pub_key; in do_dh_print() local
323 priv_key = x->priv_key; in do_dh_print()
325 priv_key = NULL; in do_dh_print()
341 update_buflen(priv_key, &buf_len); in do_dh_print()
362 if (!ASN1_bn_print(bp, "private-key:", priv_key, m, indent)) in do_dh_print()
H A Ddh_local.h89 BIGNUM *priv_key; /* x */ member
/dragonfly/crypto/libressl/crypto/gost/
H A Dgostr341001_key.c67 BIGNUM *priv_key; member
86 ret->priv_key = NULL; in GOST_KEY_new()
106 BN_clear_free(r->priv_key); in GOST_KEY_free()
157 if (key->priv_key != NULL) { in GOST_KEY_check_key()
158 if (BN_cmp(key->priv_key, order) >= 0) { in GOST_KEY_check_key()
162 if (EC_POINT_mul(key->group, point, key->priv_key, NULL, NULL, in GOST_KEY_check_key()
250 return key->priv_key; in GOST_KEY_get0_private_key()
254 GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key) in GOST_KEY_set_private_key() argument
256 BN_clear_free(key->priv_key); in GOST_KEY_set_private_key()
257 key->priv_key = BN_dup(priv_key); in GOST_KEY_set_private_key()
[all …]
H A Dgostr341001.c108 const BIGNUM *priv_key = NULL; in gost2001_compute_public() local
122 if ((priv_key = GOST_KEY_get0_private_key(ec)) == NULL) in gost2001_compute_public()
128 if (EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx) == 0) in gost2001_compute_public()
152 const BIGNUM *priv_key; in gost2001_do_sign() local
176 priv_key = GOST_KEY_get0_private_key(eckey); in gost2001_do_sign()
223 if (BN_mod_mul(tmp, priv_key, r, order, ctx) == 0) in gost2001_do_sign()
330 VKO_compute_key(BIGNUM *X, BIGNUM *Y, const GOST_KEY *pkey, GOST_KEY *priv_key, in VKO_compute_key() argument
334 const BIGNUM *key = GOST_KEY_get0_private_key(priv_key); in VKO_compute_key()
335 const EC_GROUP *group = GOST_KEY_get0_group(priv_key); in VKO_compute_key()
H A Dgostr341001_ameth.c412 ASN1_INTEGER *priv_key = NULL; in priv_decode_gost01() local
447 priv_key = d2i_ASN1_INTEGER(NULL, &p, priv_len); in priv_decode_gost01()
448 if (priv_key == NULL) in priv_decode_gost01()
450 ret = ((pk_num = ASN1_INTEGER_to_BN(priv_key, NULL)) != NULL); in priv_decode_gost01()
451 ASN1_INTEGER_free(priv_key); in priv_decode_gost01()
H A Dgost_locl.h105 GOST_KEY *priv_key, const BIGNUM *ukm);
/dragonfly/crypto/libressl/apps/openssl/
H A Dtestdsa.h219 BIGNUM *priv_key = NULL, *pub_key = NULL; in get_dsa() local
225 priv_key = BN_bin2bn(priv, priv_size, NULL); in get_dsa()
227 if (priv_key == NULL || pub_key == NULL) in get_dsa()
230 if (!DSA_set0_key(dsa, pub_key, priv_key)) in get_dsa()
233 priv_key = NULL; in get_dsa()
251 BN_free(priv_key); in get_dsa()
/dragonfly/crypto/libressl/crypto/ecdh/
H A Dech_key.c103 const BIGNUM *priv_key; in ecdh_compute_key() local
123 priv_key = EC_KEY_get0_private_key(ecdh); in ecdh_compute_key()
124 if (priv_key == NULL) { in ecdh_compute_key()
139 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ecdh_compute_key()
/dragonfly/lib/libssh/openbsd-compat/
H A Dopenssl-compat.h83 const BIGNUM **priv_key);
87 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
158 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
162 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
/dragonfly/contrib/wpa_supplicant/src/crypto/
H A Dcrypto_openssl.c783 privlen = BN_num_bytes(dh->priv_key); in dh5_init()
789 BN_bn2bin(dh->priv_key, wpabuf_put(privkey, privlen)); in dh5_init()
805 const BIGNUM *priv_key = NULL, *pub_key = NULL; in dh5_init()
828 DH_get0_key(dh, &pub_key, &priv_key); in dh5_init()
833 privlen = BN_num_bytes(priv_key); in dh5_init()
839 BN_bn2bin(priv_key, wpabuf_put(privkey, privlen)); in dh5_init()
877 if (dh->priv_key == NULL) in dh5_init_fixed()
894 BIGNUM *p = NULL, *g, *priv_key = NULL, *pub_key = NULL; in dh5_init_fixed()
910 if (!priv_key || !pub_key || DH_set0_key(dh, pub_key, priv_key) != 1) in dh5_init_fixed()
913 priv_key = NULL; in dh5_init_fixed()
[all …]
/dragonfly/crypto/libressl/ssl/
H A Dssl_rsa.c401 EVP_PKEY *priv_key = c->pkeys[i].privatekey; in ssl_set_cert() local
403 EVP_PKEY_copy_parameters(pkey, priv_key); in ssl_set_cert()
410 if (EVP_PKEY_id(priv_key) != EVP_PKEY_RSA || in ssl_set_cert()
411 !(RSA_flags(EVP_PKEY_get0_RSA(priv_key)) & RSA_METHOD_FLAG_NO_CHECK)) { in ssl_set_cert()
412 if (!X509_check_private_key(x, priv_key)) { in ssl_set_cert()
/dragonfly/contrib/ldns/
H A Dkeys.c922 BIGNUM *p=NULL, *q=NULL, *g=NULL, *priv_key=NULL, *pub_key=NULL; in ldns_key_new_frm_fp_dsa_l() local
969 priv_key = BN_bin2bn((const char unsigned*)buf, i, NULL); in ldns_key_new_frm_fp_dsa_l()
970 if (!priv_key) { in ldns_key_new_frm_fp_dsa_l()
990 dsa->priv_key = priv_key; in ldns_key_new_frm_fp_dsa_l()
999 if(!DSA_set0_key(dsa, pub_key, priv_key)) in ldns_key_new_frm_fp_dsa_l()
1015 BN_free(priv_key); in ldns_key_new_frm_fp_dsa_l()
1699 const BIGNUM *pub_key, *priv_key; in ldns_key_dsa2bin() local
1712 DSA_get0_key(k, &pub_key, &priv_key); in ldns_key_dsa2bin()
1714 pub_key = k->pub_key; priv_key = k->priv_key; in ldns_key_dsa2bin()
1716 (void)priv_key; in ldns_key_dsa2bin()
/dragonfly/crypto/libressl/crypto/ecdsa/
H A Decs_ossl.c264 const BIGNUM *ckinv, *priv_key; in ecdsa_do_sign() local
273 priv_key = EC_KEY_get0_private_key(eckey); in ecdsa_do_sign()
275 if (group == NULL || priv_key == NULL || ecdsa == NULL) { in ecdsa_do_sign()
349 if (!BN_mod_mul(bxr, b, priv_key, order, ctx)) { /* bx */ in ecdsa_do_sign()
/dragonfly/crypto/libressl/include/openssl/
H A Ddh.h152 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key);
153 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
H A Ddsa.h208 void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key);
209 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
/dragonfly/crypto/libressl/crypto/pem/
H A Dpvkfmt.c337 if (!read_lebn(&p, 20, &dsa->priv_key)) in b2i_dss()
345 dsa->priv_key, dsa->p, ctx)) in b2i_dss()
560 if (BN_num_bits(dsa->priv_key) > 160) in check_bitlen_dsa()
637 write_lebn(out, dsa->priv_key, 20); in write_dsa()

12