Home
last modified time | relevance | path

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

12

/third_party/openssl/crypto/dsa/
Ddsa_key.c29 BIGNUM *pub_key = NULL, *priv_key = NULL; in dsa_builtin_keygen() local
34 if (dsa->priv_key == NULL) { in dsa_builtin_keygen()
35 if ((priv_key = BN_secure_new()) == NULL) in dsa_builtin_keygen()
38 priv_key = dsa->priv_key; in dsa_builtin_keygen()
41 if (!BN_priv_rand_range(priv_key, dsa->q)) in dsa_builtin_keygen()
43 while (BN_is_zero(priv_key)) ; in dsa_builtin_keygen()
56 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in dsa_builtin_keygen()
66 dsa->priv_key = priv_key; in dsa_builtin_keygen()
73 if (priv_key != dsa->priv_key) in dsa_builtin_keygen()
74 BN_free(priv_key); in dsa_builtin_keygen()
Ddsa_lib.c130 BN_clear_free(r->priv_key); in DSA_free()
194 BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL; in DSA_dup_DH() local
218 if (r->priv_key != NULL) { in DSA_dup_DH()
219 priv_key = BN_dup(r->priv_key); in DSA_dup_DH()
220 if (priv_key == NULL) in DSA_dup_DH()
223 if (!DH_set0_key(ret, pub_key, priv_key)) in DSA_dup_DH()
225 } else if (r->priv_key != NULL) { in DSA_dup_DH()
237 BN_free(priv_key); in DSA_dup_DH()
281 const BIGNUM **pub_key, const BIGNUM **priv_key) in DSA_get0_key() argument
285 if (priv_key != NULL) in DSA_get0_key()
[all …]
Ddsa_ameth.c167 if ((dsa->priv_key = BN_secure_new()) == NULL in dsa_priv_decode()
168 || !ASN1_INTEGER_to_BN(privkey, dsa->priv_key)) { in dsa_priv_decode()
182 BN_set_flags(dsa->priv_key, BN_FLG_CONSTTIME); in dsa_priv_decode()
183 if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { in dsa_priv_decode()
210 if (!pkey->pkey.dsa || !pkey->pkey.dsa->priv_key) { in dsa_priv_encode()
230 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL); in dsa_priv_encode()
333 const BIGNUM *priv_key, *pub_key; in do_dsa_print() local
336 priv_key = x->priv_key; in do_dsa_print()
338 priv_key = NULL; in do_dsa_print()
352 if (priv_key) { in do_dsa_print()
[all …]
Ddsa_ossl.c75 if (dsa->priv_key == NULL) { in dsa_do_sign()
133 if (!BN_mod_mul(tmp, blind, dsa->priv_key, dsa->q, ctx)) in dsa_do_sign()
202 if (dsa->priv_key == NULL) { in dsa_sign_setup()
232 if (!BN_generate_dsa_nonce(k, dsa->q, dsa->priv_key, dgst, in dsa_sign_setup()
/third_party/openssl/crypto/ec/
Dec_key.c69 BN_clear_free(r->priv_key); in EC_KEY_free()
112 if (src->priv_key != NULL) { in EC_KEY_copy()
113 if (dest->priv_key == NULL) { in EC_KEY_copy()
114 dest->priv_key = BN_new(); in EC_KEY_copy()
115 if (dest->priv_key == NULL) in EC_KEY_copy()
118 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
203 BIGNUM *priv_key = NULL; in ec_key_simple_generate_key() local
210 if (eckey->priv_key == NULL) { in ec_key_simple_generate_key()
211 priv_key = BN_new(); in ec_key_simple_generate_key()
212 if (priv_key == NULL) in ec_key_simple_generate_key()
[all …]
Decdh_ossl.c44 const BIGNUM *priv_key; in ecdh_simple_compute_key() local
59 priv_key = EC_KEY_get0_private_key(ecdh); in ecdh_simple_compute_key()
60 if (priv_key == NULL) { in ecdh_simple_compute_key()
69 !BN_mul(x, x, priv_key, ctx)) { in ecdh_simple_compute_key()
73 priv_key = x; in ecdh_simple_compute_key()
81 if (!EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx)) { in ecdh_simple_compute_key()
Dec_asn1.c997 EC_PRIVATEKEY *priv_key = NULL; in d2i_ECPrivateKey() local
1000 if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) { in d2i_ECPrivateKey()
1013 if (priv_key->parameters) { in d2i_ECPrivateKey()
1015 ret->group = EC_GROUP_new_from_ecpkparameters(priv_key->parameters); in d2i_ECPrivateKey()
1017 && priv_key->parameters->type == ECPKPARAMETERS_TYPE_EXPLICIT) in d2i_ECPrivateKey()
1026 ret->version = priv_key->version; in d2i_ECPrivateKey()
1028 if (priv_key->privateKey) { in d2i_ECPrivateKey()
1029 ASN1_OCTET_STRING *pkey = priv_key->privateKey; in d2i_ECPrivateKey()
1045 if (priv_key->publicKey) { in d2i_ECPrivateKey()
1049 pub_oct = ASN1_STRING_get0_data(priv_key->publicKey); in d2i_ECPrivateKey()
[all …]
Decdsa_ossl.c44 const BIGNUM *priv_key; in ecdsa_sign_setup() local
50 if ((priv_key = EC_KEY_get0_private_key(eckey)) == NULL) { in ecdsa_sign_setup()
91 if (!BN_generate_dsa_nonce(k, order, priv_key, in ecdsa_sign_setup()
164 const BIGNUM *priv_key; in ossl_ecdsa_sign_sig() local
167 priv_key = EC_KEY_get0_private_key(eckey); in ossl_ecdsa_sign_sig()
173 if (priv_key == NULL) { in ossl_ecdsa_sign_sig()
241 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { in ossl_ecdsa_sign_sig()
/third_party/openssl/crypto/dh/
Ddh_key.c110 BIGNUM *pub_key = NULL, *priv_key = NULL; in generate_key() local
121 if (dh->priv_key == NULL) { in generate_key()
122 priv_key = BN_secure_new(); in generate_key()
123 if (priv_key == NULL) in generate_key()
127 priv_key = dh->priv_key; in generate_key()
146 if (!BN_priv_rand_range(priv_key, dh->q)) in generate_key()
149 while (BN_is_zero(priv_key) || BN_is_one(priv_key)); in generate_key()
153 if (!BN_priv_rand(priv_key, l, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) in generate_key()
161 if (!BN_clear_bit(priv_key, 0)) in generate_key()
172 BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); in generate_key()
[all …]
Ddh_lib.c126 BN_clear_free(r->priv_key); in DH_free()
226 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) in DH_get0_key() argument
230 if (priv_key != NULL) in DH_get0_key()
231 *priv_key = dh->priv_key; in DH_get0_key()
234 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) in DH_set0_key() argument
240 if (priv_key != NULL) { in DH_set0_key()
241 BN_clear_free(dh->priv_key); in DH_set0_key()
242 dh->priv_key = priv_key; in DH_set0_key()
265 return dh->priv_key; in DH_get0_priv_key()
Ddh_ameth.c179 if ((dh->priv_key = BN_secure_new()) == NULL in dh_priv_decode()
180 || !ASN1_INTEGER_to_BN(privkey, dh->priv_key)) { in dh_priv_decode()
224 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL); in dh_priv_encode()
271 BIGNUM *priv_key, *pub_key; in do_dh_print() local
274 priv_key = x->priv_key; in do_dh_print()
276 priv_key = NULL; in do_dh_print()
283 if (x->p == NULL || (ptype == 2 && priv_key == NULL) in do_dh_print()
301 if (!ASN1_bn_print(bp, "private-key:", priv_key, NULL, indent)) in do_dh_print()
Ddh_local.h24 BIGNUM *priv_key; /* x */ member
/third_party/openssl/test/
Ddhtest.c33 BIGNUM *priv_key = NULL; in dh_test() local
52 || !TEST_ptr(priv_key = BN_new())) in dh_test()
91 if (!TEST_true(BN_set_word(priv_key, 1234L)) in dh_test()
92 || !TEST_true(DH_set0_key(dh, NULL, priv_key))) in dh_test()
98 || !TEST_ptr_eq(priv_key2, priv_key)) in dh_test()
115 || !TEST_ptr_eq(priv_key2, priv_key)) in dh_test()
221 BN_free(priv_key); in dh_test()
534 BIGNUM *bady = NULL, *priv_key = NULL, *pub_key = NULL; in rfc5114_test() local
544 if (!TEST_ptr(priv_key = BN_bin2bn(td->xA, td->xA_len, NULL)) in rfc5114_test()
546 || !TEST_true(DH_set0_key(dhA, pub_key, priv_key))) in rfc5114_test()
[all …]
/third_party/openssl/apps/
Dtestdsa.h217 BIGNUM *priv_key, *pub_key, *p, *q, *g; in get_dsa() local
236 priv_key = BN_bin2bn(dsa_t.priv, dsa_t.priv_l, NULL); in get_dsa()
241 if ((priv_key == NULL) || (pub_key == NULL) || (p == NULL) || (q == NULL) in get_dsa()
248 if (!DSA_set0_key(dsa, pub_key, priv_key)) in get_dsa()
254 BN_free(priv_key); in get_dsa()
/third_party/libcoap/src/
Dcoap_tinydtls.c34 coap_binary_t *priv_key; member
352 ecdsa_key.priv_key = t_context->priv_key->s; in get_ecdsa_key()
461 if (t_context->priv_key) { in coap_dtls_free_context()
462 coap_delete_binary(t_context->priv_key); in coap_dtls_free_context()
463 t_context->priv_key = NULL; in coap_dtls_free_context()
885 t_context->priv_key = get_asn1_tag(COAP_ASN1_OCTETSTRING, priv_data, in asn1_derive_keys()
887 if (!t_context->priv_key) { in asn1_derive_keys()
892 if (t_context->priv_key->length - 1 == DTLS_EC_KEY_SIZE && in asn1_derive_keys()
893 t_context->priv_key->s[0] == '\000') { in asn1_derive_keys()
894 t_context->priv_key->length--; in asn1_derive_keys()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/common/
Ddpp_backup.c37 struct wpabuf *buf, *priv_key = NULL; in dpp_build_conf_params() local
46 priv_key = crypto_ec_key_get_ecprivate_key(conf->pp_key, false); in dpp_build_conf_params()
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()
153 struct wpabuf *key = NULL, *attr, *alg, *priv_key = NULL; in dpp_build_key_pkg() local
155 priv_key = crypto_ec_key_get_ecprivate_key(auth->conf->csign, false); in dpp_build_key_pkg()
[all …]
/third_party/openssl/crypto/pem/
Dpvkfmt.c252 BIGNUM *pbn = NULL, *qbn = NULL, *gbn = NULL, *priv_key = NULL; in b2i_dss() local
274 if (!read_lebn(&p, 20, &priv_key)) in b2i_dss()
278 BN_set_flags(priv_key, BN_FLG_CONSTTIME); in b2i_dss()
287 if (!BN_mod_exp(pub_key, gbn, priv_key, pbn, ctx)) in b2i_dss()
296 if (!DSA_set0_key(dsa, pub_key, priv_key)) in b2i_dss()
298 pub_key = priv_key = NULL; in b2i_dss()
313 BN_free(priv_key); in b2i_dss()
494 const BIGNUM *pub_key = NULL, *priv_key = NULL; in check_bitlen_dsa() local
497 DSA_get0_key(dsa, &pub_key, &priv_key); in check_bitlen_dsa()
507 if (BN_num_bits(priv_key) > 160) in check_bitlen_dsa()
[all …]
/third_party/ffmpeg/libavformat/
Dlibssh.c41 char *priv_key; member
86 if (libssh->priv_key) { in libssh_authentication()
88 ssh_private_key priv_key; in libssh_authentication() local
90 if (!ssh_try_publickey_from_file(libssh->session, libssh->priv_key, &pub_key, &type)) { in libssh_authentication()
91 priv_key = privatekey_from_file(libssh->session, libssh->priv_key, type, password); in libssh_authentication()
92 … if (ssh_userauth_pubkey(libssh->session, NULL, pub_key, priv_key) == SSH_AUTH_SUCCESS) { in libssh_authentication()
481 …{"private_key", "set path to private key", OFFSET(priv_key), AV_OPT_TYPE_STRING, { .str = NULL }, …
Drtmpdh.c231 bn_new(dh->priv_key); in dh_generate_key()
232 if (!dh->priv_key) in dh_generate_key()
234 bn_random(dh->priv_key, 8 * num_bytes); in dh_generate_key()
238 bn_free(dh->priv_key); in dh_generate_key()
242 if (bn_modexp(dh->pub_key, dh->g, dh->priv_key, dh->p) < 0) in dh_generate_key()
258 if ((ret = bn_modexp(k, pub_key_bn, dh->priv_key, dh->p)) < 0) { in dh_compute_key()
276 bn_free(dh->priv_key); in ff_dh_free()
Dtls_mbedtls.c46 mbedtls_pk_context priv_key; member
57 mbedtls_pk_free(&tls_ctx->priv_key); in tls_close()
180 mbedtls_pk_init(&tls_ctx->priv_key); in tls_open()
200 if ((ret = mbedtls_pk_parse_keyfile(&tls_ctx->priv_key, in tls_open()
231 … = mbedtls_ssl_conf_own_cert(&tls_ctx->ssl_config, &tls_ctx->own_cert, &tls_ctx->priv_key)) != 0) { in tls_open()
Drtmpdh.h54 FFBigNum priv_key; member
/third_party/openssl/doc/man3/
DDH_get0_pqg.pod19 const BIGNUM **pub_key, const BIGNUM **priv_key);
20 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
37 (optionally) a private key (B<priv_key>).
55 private key will be stored in B<*priv_key>. Either may be NULL if they have not
59 Any of the out parameters B<pub_key> and B<priv_key> can be NULL, in which case
68 Any of the values B<p>, B<q>, B<g>, B<priv_key>, and B<pub_key> can also be
DDSA_get0_pqg.pod20 const BIGNUM **pub_key, const BIGNUM **priv_key);
21 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
35 public key (B<pub_key>) and (optionally) a private key (B<priv_key>).
51 private key will be stored in B<*priv_key>. Either may be NULL if they have not
64 Any of the values B<p>, B<q>, B<g>, B<priv_key>, and B<pub_key> can also be
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/crypto/
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()
876 dh->priv_key = BN_bin2bn(wpabuf_head(priv), wpabuf_len(priv), NULL); in dh5_init_fixed()
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()
908 priv_key = BN_bin2bn(wpabuf_head(priv), wpabuf_len(priv), NULL); in dh5_init_fixed()
[all …]
/third_party/lwip/src/include/lwip/apps/
Dsnmpv3.h84 …ame, snmpv3_auth_algo_t *auth_algo, u8_t *auth_key, snmpv3_priv_algo_t *priv_algo, u8_t *priv_key);

12