Home
last modified time | relevance | path

Searched refs:privkey (Results 1 – 25 of 83) sorted by relevance

1234

/freebsd/crypto/openssl/crypto/ec/
H A Decx_backend.c32 ossl_x25519_public_from_private(key->pubkey, key->privkey); in ossl_ecx_public_from_private()
36 key->privkey, key->propq)) { in ossl_ecx_public_from_private()
42 ossl_x448_public_from_private(key->pubkey, key->privkey); in ossl_ecx_public_from_private()
46 key->privkey, key->propq)) { in ossl_ecx_public_from_private()
74 (void **)&ecx->privkey, ecx->keylen, in ossl_ecx_key_fromdata()
83 OPENSSL_secure_clear_free(ecx->privkey, privkeylen); in ossl_ecx_key_fromdata()
84 ecx->privkey = NULL; in ossl_ecx_key_fromdata()
135 && key->privkey != NULL) { in ossl_ecx_key_dup()
140 memcpy(ret->privkey, key->privkey, ret->keylen); in ossl_ecx_key_dup()
158 unsigned char *privkey, *pubkey; in ossl_ecx_key_op() local
[all …]
H A Decx_meth.c105 if (ecxkey == NULL || ecxkey->privkey == NULL) { in ecx_priv_encode()
110 oct.data = ecxkey->privkey; in ecx_priv_encode()
173 if (ecxkey == NULL || ecxkey->privkey == NULL) { in ecx_key_print()
182 if (ASN1_buf_print(bp, ecxkey->privkey, KEYLEN(pkey), in ecx_key_print()
307 || key->privkey == NULL in ecx_get_priv_key()
312 memcpy(priv, key->privkey, *len); in ecx_get_priv_key()
365 if (key->privkey != NULL) { in ecx_pkey_export_to()
368 key->privkey, key->keylen)) in ecx_pkey_export_to()
725 const unsigned char **privkey, in validate_ecx_derive() argument
736 if (ecxkey == NULL || ecxkey->privkey == NULL) { in validate_ecx_derive()
[all …]
H A Decx_key.c81 OPENSSL_secure_clear_free(key->privkey, key->keylen); in ossl_ecx_key_free()
105 key->privkey = OPENSSL_secure_zalloc(key->keylen); in ossl_ecx_key_allocate_privkey()
107 return key->privkey; in ossl_ecx_key_allocate_privkey()
114 || priv->privkey == NULL in ossl_ecx_compute_key()
139 if (s390x_x25519_mul(secret, peer->pubkey, priv->privkey) == 0) { in ossl_ecx_compute_key()
145 if (ossl_x25519(secret, priv->privkey, peer->pubkey) == 0) { in ossl_ecx_compute_key()
153 if (s390x_x448_mul(secret, peer->pubkey, priv->privkey) == 0) { in ossl_ecx_compute_key()
159 if (ossl_x448(secret, priv->privkey, peer->pubkey) == 0) { in ossl_ecx_compute_key()
/freebsd/crypto/openssl/providers/implementations/keymgmt/
H A Decx_kmgmt.c153 ok = ok && key->privkey != NULL; in ecx_has()
188 const unsigned char *pa = key1->privkey; in ecx_match()
189 const unsigned char *pb = key2->privkey; in ecx_match()
236 && key->privkey != NULL in key_to_params()
239 key->privkey, key->keylen)) in key_to_params()
436 OPENSSL_clear_free(ecxkey->privkey, ecxkey->keylen); in ecx_set_params()
437 ecxkey->privkey = NULL; in ecx_set_params()
665 ecx->privkey, 0, 0, 0, NULL, 0, in ecd_fips140_pairwise_test()
669 ecx->pubkey, ecx->privkey, NULL, 0, in ecd_fips140_pairwise_test()
697 unsigned char *privkey; in ecx_gen() local
[all …]
/freebsd/sbin/decryptcore/
H A Ddecryptcore.c125 RSA *privkey; in decrypt() local
136 privkey = NULL; in decrypt()
191 privkey = RSA_new(); in decrypt()
192 if (privkey == NULL) { in decrypt()
206 privkey = PEM_read_RSAPrivateKey(fp, &privkey, NULL, NULL); in decrypt()
208 if (privkey == NULL) { in decrypt()
213 privkeysize = RSA_size(privkey); in decrypt()
233 kdk->kdk_encryptedkey, key, privkey, in decrypt()
237 kdk->kdk_encryptedkey, key, privkey, in decrypt()
243 RSA_free(privkey); in decrypt()
[all …]
/freebsd/crypto/libecc/src/wycheproof_tests/
H A Dlibecc_wycheproof_tests.h367972 .privkey = ecdh_brainpoolp224r1_0_privkey,
368000 .privkey = ecdh_brainpoolp224r1_1_privkey,
368028 .privkey = ecdh_brainpoolp224r1_2_privkey,
368056 .privkey = ecdh_brainpoolp224r1_3_privkey,
368084 .privkey = ecdh_brainpoolp224r1_4_privkey,
368112 .privkey = ecdh_brainpoolp224r1_5_privkey,
368140 .privkey = ecdh_brainpoolp224r1_6_privkey,
368168 .privkey = ecdh_brainpoolp224r1_7_privkey,
368196 .privkey = ecdh_brainpoolp224r1_8_privkey,
368224 .privkey = ecdh_brainpoolp224r1_9_privkey,
[all …]
H A Dlibecc_wycheproof.h66 const unsigned char *privkey; member
95 const unsigned char *privkey; member
122 const unsigned char *privkey; member
/freebsd/crypto/openssh/regress/misc/fuzz-harness/
H A Dkex_fuzz.cc124 struct sshkey *privkey) in store_key() argument
127 privkey->type != pubkey->type || in store_key()
135 st->nkeys, privkey->type + 1, sizeof(*st->privkeys)); in store_key()
136 st->nkeys = privkey->type + 1; in store_key()
140 st->privkeys[privkey->type] = privkey; in store_key()
178 struct sshkey *privkey = NULL, *pubkey = NULL; in do_kex_with_key() local
194 privkey = get_privkey(st, keytype); in do_kex_with_key()
195 keyname = xstrdup(sshkey_ssh_name(privkey)); in do_kex_with_key()
229 if ((r = ssh_add_hostkey(server, privkey)) != 0 || in do_kex_with_key()
257 struct sshkey *privkey = NULL, *pubkey = NULL; in prepare_key() local
[all …]
H A Dagent_fuzz_helper.c44 struct sshkey *privkey; in privkey_or_die() local
50 if ((r = sshkey_parse_private_fileblob(b, "", &privkey, NULL)) != 0) { in privkey_or_die()
55 return privkey; in privkey_or_die()
59 add_key(const char *privkey, const char *certpath) in add_key() argument
68 id->key = privkey_or_die(privkey); in add_key()
77 id->key = privkey_or_die(privkey); in add_key()
/freebsd/crypto/openssl/test/recipes/
H A D20-test_dgst.t24 my $privkey = shift;
30 my $sigfile = basename($privkey, '.pem') . '.sig';
33 ok(run(app(['openssl', 'dgst', '-sign', $privkey,
38 ok(run(app(['openssl', 'dgst', '-prverify', $privkey,
56 my $privkey = shift;
62 my $sigfile = basename($privkey, '.pem') . '.sig';
65 ok(run(app(['openssl', 'sha512', '-sign', $privkey,
75 ok(run(app(['openssl', 'dgst', '-sha512', '-prverify', $privkey,
H A D20-test_pkeyutl.t105 my $privkey = shift;
111 $sigfile = basename($privkey, '.pem') . '.sig';
117 '-inkey', $privkey,
125 '-inkey', $privkey,
138 '-inkey', $privkey,
/freebsd/contrib/wpa/src/crypto/
H A Dcrypto_internal-modexp.c16 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
21 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
23 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
25 privkey[0] = 0; in crypto_dh_init()
29 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
44 const u8 *privkey, size_t privkey_len, in crypto_dh_derive_secret() argument
81 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
/freebsd/crypto/libecc/scripts/
H A Dexpand_libecc.py288 def __init__(self, pubkey, privkey): argument
290 self.privkey = privkey
293 def fromprivkey(privkey, is_eckcdsa=False): argument
294 curve = privkey.curve
300 return PubKey(curve, privkey.x * G)
302 return PubKey(curve, modinv(privkey.x, q) * G)
316 privkey = PrivKey(curve, x)
317 pubkey = fromprivkey(privkey, is_eckcdsa)
318 return KeyPair(pubkey, privkey)
492 privkey = keypair.privkey
[all …]
/freebsd/crypto/openssl/test/
H A Dquic_newcid_test.c17 static char *privkey = NULL; variable
70 if (!TEST_true(qtest_create_quic_objects(NULL, cctx, NULL, cert, privkey, 0, in test_ncid_frame()
167 privkey = test_mk_file_path(certsdir, "serverkey.pem"); in setup_tests()
168 if (privkey == NULL) in setup_tests()
177 OPENSSL_free(privkey); in setup_tests()
184 OPENSSL_free(privkey); in cleanup_tests()
H A Dquicfaultstest.c17 static char *privkey = NULL; variable
37 if (!TEST_true(qtest_create_quic_objects(NULL, cctx, NULL, cert, privkey, 0, in test_basic()
107 if (!TEST_true(qtest_create_quic_objects(NULL, cctx, NULL, cert, privkey, 0, in test_unknown_frame()
189 if (!TEST_true(qtest_create_quic_objects(NULL, cctx, NULL, cert, privkey, 0, in test_drop_extensions()
276 if (!TEST_true(qtest_create_quic_objects(NULL, cctx, NULL, cert, privkey, in test_corrupted_data()
390 privkey = test_mk_file_path(certsdir, "serverkey.pem"); in setup_tests()
391 if (privkey == NULL) in setup_tests()
403 OPENSSL_free(privkey); in setup_tests()
410 OPENSSL_free(privkey); in cleanup_tests()
H A Dcert_comp_test.c39 static char *privkey = NULL; variable
58 || !TEST_ptr(priv_in = BIO_new_file(privkey, "r")) in client_cert_cb()
165 &sctx, &cctx, cert, privkey))) in test_ssl_cert_comp()
266 privkey = test_mk_file_path(certsdir, "serverkey.pem"); in setup_tests()
267 if (privkey == NULL) in setup_tests()
275 OPENSSL_free(privkey); in setup_tests()
286 OPENSSL_free(privkey); in cleanup_tests()
H A Ddecoder_propq_test.c51 EVP_PKEY *privkey = NULL; in test_decode_nonfipsalg() local
67 if (!TEST_ptr_null(PEM_read_bio_PrivateKey_ex(bio, &privkey, &passcb, NULL, libctx, NULL))) in test_decode_nonfipsalg()
74 …if (!TEST_ptr_null(PEM_read_bio_PrivateKey_ex(bio, &privkey, &passcb, NULL, libctx, "?fips=true"))) in test_decode_nonfipsalg()
80 EVP_PKEY_free(privkey); in test_decode_nonfipsalg()
H A Dx509_test.c21 static EVP_PKEY *privkey = NULL; variable
99 && TEST_int_gt(X509_sign(x, privkey, signmd), 0) in test_x509_tbs_cache()
117 && TEST_int_gt(X509_CRL_sign(crl, privkey, signmd), 0) in test_x509_crl_tbs_cache()
304 privkey = d2i_PrivateKey(EVP_PKEY_EC, NULL, &p, sizeof(privkeydata)); in setup_tests()
306 if (pubkey == NULL || privkey == NULL) { in setup_tests()
331 EVP_PKEY_free(privkey); in cleanup_tests()
H A Dcmsapitest.c21 static EVP_PKEY *privkey = NULL; variable
46 if (!TEST_true(CMS_decrypt(content, privkey, cert, NULL, outmsgbio, in test_encrypt_decrypt()
52 NULL, privkey, cert, NULL, in test_encrypt_decrypt()
98 && TEST_ptr(CMS_add1_signer(cms, cert, privkey, NULL, 0)) in test_CMS_add1_cert()
497 if (!TEST_false(CMS_decrypt(cms, privkey, cert, NULL, out, 0))) in test_cms_aesgcm_iv_too_long()
548 if (!TEST_true(PEM_read_bio_PrivateKey(privkeybio, &privkey, NULL, NULL))) { in setup_tests()
573 EVP_PKEY_free(privkey); in cleanup_tests()
H A Ddtlstest.c20 static char *privkey = NULL; variable
82 &sctx, &cctx, cert, privkey))) in test_dtls_unprocessed()
200 &sctx, &cctx, cert, privkey))) in test_dtls_drop_records()
314 &sctx, &cctx, cert, privkey))) in test_cookie()
354 &sctx, &cctx, cert, privkey))) in test_dtls_duplicate_records()
420 &sctx, NULL, cert, privkey))) in test_just_finished()
485 &sctx, &cctx, cert, privkey))) in test_swap_records()
598 &sctx, &cctx, cert, privkey))) in test_duplicate_app_data()
694 &sctx, &cctx, cert, privkey))) in test_listen()
743 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
H A Dfatalerrtest.c17 static char *privkey = NULL; variable
33 &sctx, &cctx, cert, privkey))) in test_fatalerr()
95 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
/freebsd/crypto/openssl/crypto/dsa/
H A Ddsa_backend.c130 ASN1_INTEGER *privkey = NULL; in ossl_dsa_key_from_pkcs8() local
141 if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) in ossl_dsa_key_from_pkcs8()
143 if (privkey->type == V_ASN1_NEG_INTEGER || ptype != V_ASN1_SEQUENCE) in ossl_dsa_key_from_pkcs8()
153 || !ASN1_INTEGER_to_BN(privkey, dsa_privkey)) { in ossl_dsa_key_from_pkcs8()
190 ASN1_STRING_clear_free(privkey); in ossl_dsa_key_from_pkcs8()
/freebsd/crypto/openssl/crypto/ec/curve448/
H A Ded448.h43 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
66 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
92 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
/freebsd/crypto/openssl/crypto/dh/
H A Ddh_backend.c190 ASN1_INTEGER *privkey = NULL; in ossl_dh_key_from_pkcs8() local
200 if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) in ossl_dh_key_from_pkcs8()
221 || !ASN1_INTEGER_to_BN(privkey, privkey_bn)) { in ossl_dh_key_from_pkcs8()
240 ASN1_STRING_clear_free(privkey); in ossl_dh_key_from_pkcs8()
/freebsd/crypto/openssl/fuzz/
H A Dserver.c2325 RSA *privkey; in FuzzerTestOneInput() local
2356 privkey = d2i_RSAPrivateKey(NULL, &bufp, sizeof(kRSAPrivateKeyDER)); in FuzzerTestOneInput()
2357 OPENSSL_assert(privkey != NULL); in FuzzerTestOneInput()
2359 EVP_PKEY_assign_RSA(pkey, privkey); in FuzzerTestOneInput()

1234