Home
last modified time | relevance | path

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

12

/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()
235 BN_clear_free(r->priv_key); in DSA_free()
300 return d->priv_key; in DSA_get0_priv_key()
308 if (priv_key != NULL) in DSA_get0_key()
309 *priv_key = d->priv_key; in DSA_get0_key()
318 if (priv_key != NULL) { in DSA_set0_key()
319 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.c55 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) in ossl_dsa_check_priv_key() argument
60 && ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret)); in ossl_dsa_check_priv_key()
75 || dsa->priv_key == NULL in ossl_dsa_check_pairwise()
87 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()
/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 …]
H A Decdsa_ossl.c85 const BIGNUM *priv_key; in ecdsa_sign_setup() local
91 if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) { in ecdsa_sign_setup()
132 if (!BN_generate_dsa_nonce(k, order, priv_key, in ecdsa_sign_setup()
203 const BIGNUM *priv_key; in ossl_ecdsa_simple_sign_sig() local
206 priv_key = EC_KEY_get0_private_key(eckey); in ossl_ecdsa_simple_sign_sig()
212 if (priv_key == NULL) { in ossl_ecdsa_simple_sign_sig()
280 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { in ossl_ecdsa_simple_sign_sig()
/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()
432 if (gctx->priv_key == NULL) { in mac_gen_set_params()
497 if (gctx->priv_key == NULL) { in mac_gen()
515 key->priv_key = gctx->priv_key; in mac_gen()
[all …]
/openssl/crypto/dh/
H A Ddh_key.c66 if (dh->priv_key == NULL) { in ossl_dh_compute_key()
74 BN_set_flags(dh->priv_key, BN_FLG_CONSTTIME); in ossl_dh_compute_key()
244 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in ossl_dh_generate_public_key()
264 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local
280 if (dh->priv_key == NULL) { in generate_key()
281 priv_key = BN_secure_new(); in generate_key()
282 if (priv_key == NULL) in generate_key()
286 priv_key = dh->priv_key; in generate_key()
358 dh->priv_key = priv_key; in generate_key()
367 if (priv_key != dh->priv_key) in generate_key()
[all …]
H A Ddh_lib.c157 BN_clear_free(r->priv_key); in DH_free()
253 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
257 if (priv_key != NULL) in DH_get0_key()
258 *priv_key = dh->priv_key; in DH_get0_key()
261 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
267 if (priv_key != NULL) { in DH_set0_key()
268 BN_clear_free(dh->priv_key); in DH_set0_key()
269 dh->priv_key = priv_key; in DH_set0_key()
293 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.c251 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret) in ossl_dh_check_priv_key() argument
273 if (BN_num_bits(priv_key) <= length in ossl_dh_check_priv_key()
274 && BN_num_bits(priv_key) > 1) in ossl_dh_check_priv_key()
276 } else if (BN_num_bits(priv_key) == length) { in ossl_dh_check_priv_key()
292 if (!ossl_ffc_validate_private_key(upper, priv_key, ret)) in ossl_dh_check_priv_key()
313 || dh->priv_key == NULL in ossl_dh_check_pairwise()
325 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()
/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()
/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()
/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()
/openssl/demos/encrypt/
H A Drsa_encrypt.c162 EVP_PKEY *priv_key = NULL; in do_decrypt() local
166 priv_key = get_key(libctx, propq, public); in do_decrypt()
167 if (priv_key == NULL) { in do_decrypt()
171 ctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv_key, propq); in do_decrypt()
208 EVP_PKEY_free(priv_key); in do_decrypt()
/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()
216 BN_free(priv_key); in dh_test()
563 BIGNUM *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local
575 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test()
580 || !TEST_true(DH_set0_key(dhB, pub_key, priv_key))) in rfc5114_test()
582 priv_key = pub_key = NULL; in rfc5114_test()
[all …]
/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()
519 const BIGNUM *priv_key = EC_KEY_get0_private_key(ec); in ec_to_text() local
[all …]
/openssl/include/crypto/
H A Ddsa.h39 const BIGNUM *priv_key, BIGNUM *pub_key);
44 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret);
H A Ddh.h25 const BIGNUM *priv_key, BIGNUM *pub_key);
44 int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret);
/openssl/crypto/pem/
H A Dpvkfmt.c401 if (!read_lebn(&p, 20, &priv_key)) in ossl_b2i_DSA_after_header()
405 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in ossl_b2i_DSA_after_header()
423 if (!DSA_set0_key(dsa, pub_key, priv_key)) in ossl_b2i_DSA_after_header()
425 pub_key = priv_key = NULL; in ossl_b2i_DSA_after_header()
437 BN_free(priv_key); in ossl_b2i_DSA_after_header()
693 const BIGNUM *pub_key = NULL, *priv_key = NULL; in check_bitlen_dsa() local
696 DSA_get0_key(dsa, &pub_key, &priv_key); in check_bitlen_dsa()
706 if (BN_num_bits(priv_key) > 160) in check_bitlen_dsa()
721 const BIGNUM *pub_key = NULL, *priv_key = NULL; in write_dsa() local
724 DSA_get0_key(dsa, &pub_key, &priv_key); in write_dsa()
[all …]

Completed in 63 milliseconds

12