Home
last modified time | relevance | path

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

123

/freebsd-14.2/crypto/openssl/crypto/ec/
H A Decx_backend.c85 ecx->privkey = NULL; in ossl_ecx_key_fromdata()
143 && key->privkey != NULL) { in ossl_ecx_key_dup()
146 memcpy(ret->privkey, key->privkey, ret->keylen); in ossl_ecx_key_dup()
164 unsigned char *privkey, *pubkey; in ossl_ecx_key_op() local
200 privkey = ossl_ecx_key_allocate_privkey(key); in ossl_ecx_key_op()
201 if (privkey == NULL) { in ossl_ecx_key_op()
210 privkey[0] &= 248; in ossl_ecx_key_op()
212 privkey[X25519_KEYLEN - 1] |= 64; in ossl_ecx_key_op()
214 privkey[0] &= 252; in ossl_ecx_key_op()
215 privkey[X448_KEYLEN - 1] |= 128; in ossl_ecx_key_op()
[all …]
H A Decx_meth.c112 oct.data = ecxkey->privkey; in ecx_priv_encode()
745 *privkey = ecxkey->privkey; in validate_ecx_derive()
955 if (privkey == NULL) { in s390x_pkey_ecx_keygen25519()
963 privkey[0] &= 248; in s390x_pkey_ecx_keygen25519()
964 privkey[31] &= 127; in s390x_pkey_ecx_keygen25519()
965 privkey[31] |= 64; in s390x_pkey_ecx_keygen25519()
998 if (privkey == NULL) { in s390x_pkey_ecx_keygen448()
1006 privkey[0] &= 252; in s390x_pkey_ecx_keygen448()
1007 privkey[55] |= 128; in s390x_pkey_ecx_keygen448()
1047 if (privkey == NULL) { in s390x_pkey_ecd_keygen25519()
[all …]
H A Decx_key.c71 OPENSSL_secure_clear_free(key->privkey, key->keylen); in ossl_ecx_key_free()
95 key->privkey = OPENSSL_secure_zalloc(key->keylen); in ossl_ecx_key_allocate_privkey()
97 return key->privkey; in ossl_ecx_key_allocate_privkey()
/freebsd-14.2/crypto/openssl/providers/implementations/keymgmt/
H A Decx_kmgmt.c604 privkey[0] &= 248; in ecx_gen()
610 privkey[0] &= 252; in ecx_gen()
854 if (privkey == NULL) { in MAKE_KEYMGMT_FUNCTIONS()
862 privkey[0] &= 248; in MAKE_KEYMGMT_FUNCTIONS()
863 privkey[31] &= 127; in MAKE_KEYMGMT_FUNCTIONS()
864 privkey[31] |= 64; in MAKE_KEYMGMT_FUNCTIONS()
900 if (privkey == NULL) { in s390x_ecx_keygen448()
908 privkey[0] &= 252; in s390x_ecx_keygen448()
909 privkey[55] |= 128; in s390x_ecx_keygen448()
952 if (privkey == NULL) { in s390x_ecd_keygen25519()
[all …]
/freebsd-14.2/sbin/decryptcore/
H A Ddecryptcore.c126 RSA *privkey; in decrypt() local
137 privkey = NULL; in decrypt()
192 privkey = RSA_new(); in decrypt()
193 if (privkey == NULL) { in decrypt()
207 privkey = PEM_read_RSAPrivateKey(fp, &privkey, NULL, NULL); in decrypt()
209 if (privkey == NULL) { in decrypt()
214 privkeysize = RSA_size(privkey); in decrypt()
234 kdk->kdk_encryptedkey, key, privkey, in decrypt()
244 RSA_free(privkey); in decrypt()
245 privkey = NULL; in decrypt()
[all …]
/freebsd-14.2/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.t87 my $privkey = shift;
93 my $sigfile = basename($privkey, '.pem') . '.sig';
99 '-inkey', $privkey,
107 '-inkey', $privkey,
116 '-inkey', $privkey,
/freebsd-14.2/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()
H A Dcrypto_nettle.c307 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
312 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
314 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
316 privkey[0] = 0; in crypto_dh_init()
320 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
335 const u8 *privkey, size_t privkey_len, in crypto_dh_derive_secret() argument
367 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
H A Dcrypto_gnutls.c286 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
291 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
293 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
295 privkey[0] = 0; in crypto_dh_init()
299 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
314 const u8 *privkey, size_t privkey_len, in crypto_dh_derive_secret() argument
353 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
/freebsd-14.2/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()
136 st->nkeys = privkey->type + 1; in store_key()
140 st->privkeys[privkey->type] = privkey; in store_key()
179 struct sshkey *privkey = NULL, *pubkey = NULL; in do_kex_with_key() local
195 privkey = get_privkey(st, keytype); in do_kex_with_key()
196 keyname = xstrdup(sshkey_ssh_name(privkey)); in do_kex_with_key()
258 struct sshkey *privkey = NULL, *pubkey = NULL; in prepare_key() local
298 store_key(st, pubkey, privkey); in prepare_key()
308 struct sshkey *privkey = NULL, *pubkey = NULL;
[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-14.2/crypto/openssl/test/
H A Dtls-provider.c44 unsigned char privkey[XOR_KEY_SIZE]; member
286 secret[i] = pxorctx->key->privkey[i] ^ pxorctx->peerkey->pubkey[i]; in xor_derive()
505 memcpy(tokey->privkey, fromkey->privkey, XOR_KEY_SIZE); in xor_dup()
654 key->pubkey[i] = key->privkey[i] ^ private_constant[i]; in xor_gen()
668 unsigned char privkey[XOR_KEY_SIZE]; in xor_import() local
670 void *pprivkey = privkey, *ppubkey = pubkey; in xor_import()
677 memset(privkey, 0, sizeof(privkey)); in xor_import()
684 sizeof(privkey), &priv_len)) in xor_import()
691 memcpy(key->privkey, privkey, priv_len); in xor_import()
713 key->privkey, in xor_export()
[all …]
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()
H A Ddtlstest.c20 static char *privkey = NULL; variable
83 &sctx, &cctx, cert, privkey))) in test_dtls_unprocessed()
205 &sctx, &cctx, cert, privkey))) in test_dtls_drop_records()
318 &sctx, &cctx, cert, privkey))) in test_cookie()
358 &sctx, &cctx, cert, privkey))) in test_dtls_duplicate_records()
425 &sctx, NULL, cert, privkey))) in test_just_finished()
484 &sctx, &cctx, cert, privkey))) in test_swap_records()
593 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
H A Dcmsapitest.c20 static EVP_PKEY *privkey = NULL; variable
43 if (!TEST_true(CMS_decrypt(content, privkey, cert, NULL, outmsgbio, in test_encrypt_decrypt()
391 if (!TEST_true(PEM_read_bio_PrivateKey(privkeybio, &privkey, NULL, NULL))) { in setup_tests()
411 EVP_PKEY_free(privkey); in cleanup_tests()
H A Drecordlentest.c16 static char *privkey = NULL; variable
107 &sctx, &cctx, cert, privkey))) in test_record_overflow()
194 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
/freebsd-14.2/crypto/openssl/crypto/dsa/
H A Ddsa_backend.c132 ASN1_INTEGER *privkey = NULL; in ossl_dsa_key_from_pkcs8() local
143 if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) in ossl_dsa_key_from_pkcs8()
145 if (privkey->type == V_ASN1_NEG_INTEGER || ptype != V_ASN1_SEQUENCE) in ossl_dsa_key_from_pkcs8()
155 || !ASN1_INTEGER_to_BN(privkey, dsa_privkey)) { in ossl_dsa_key_from_pkcs8()
192 ASN1_STRING_clear_free(privkey); in ossl_dsa_key_from_pkcs8()
/freebsd-14.2/crypto/openssl/providers/implementations/exchange/
H A Decx_exch.c125 || ecxctx->key->privkey == NULL in ecx_derive()
151 ecxctx->key->privkey) == 0) { in ecx_derive()
157 if (ossl_x25519(secret, ecxctx->key->privkey, in ecx_derive()
167 ecxctx->key->privkey) == 0) { in ecx_derive()
173 if (ossl_x448(secret, ecxctx->key->privkey, in ecx_derive()
/freebsd-14.2/crypto/openssl/crypto/ec/curve448/
H A Ded448.h44 const uint8_t privkey [EDDSA_448_PRIVATE_BYTES],
67 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
93 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
H A Deddsa.c114 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in ossl_c448_ed448_derive_public_key()
124 privkey, in ossl_c448_ed448_derive_public_key()
161 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in ossl_c448_ed448_sign()
185 if (!oneshot_hash(ctx, expanded, sizeof(expanded), privkey, in ossl_c448_ed448_sign()
270 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in ossl_c448_ed448_sign_prehash()
275 return ossl_c448_ed448_sign(ctx, signature, privkey, pubkey, hash, 64, 1, in ossl_c448_ed448_sign_prehash()
/freebsd-14.2/crypto/openssl/fuzz/
H A Dserver.c521 RSA *privkey; in FuzzerTestOneInput() local
552 privkey = d2i_RSAPrivateKey(NULL, &bufp, sizeof(kRSAPrivateKeyDER)); in FuzzerTestOneInput()
553 OPENSSL_assert(privkey != NULL); in FuzzerTestOneInput()
555 EVP_PKEY_assign_RSA(pkey, privkey); in FuzzerTestOneInput()
/freebsd-14.2/crypto/openssl/crypto/dh/
H A Ddh_backend.c197 ASN1_INTEGER *privkey = NULL; in ossl_dh_key_from_pkcs8() local
207 if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) in ossl_dh_key_from_pkcs8()
228 || !ASN1_INTEGER_to_BN(privkey, privkey_bn)) { in ossl_dh_key_from_pkcs8()
247 ASN1_STRING_clear_free(privkey); in ossl_dh_key_from_pkcs8()
/freebsd-14.2/crypto/openssl/providers/implementations/signature/
H A Deddsa_sig.c168 if (edkey->privkey == NULL) { in ed25519_digest_sign()
182 if (ossl_ed25519_sign(sigret, tbs, tbslen, edkey->pubkey, edkey->privkey, in ed25519_digest_sign()
209 if (edkey->privkey == NULL) { in ed448_digest_sign()
224 edkey->privkey, NULL, 0, edkey->propq) == 0) { in ed448_digest_sign()
384 memcpy(param.ed25519.priv, edkey->privkey, sizeof(param.ed25519.priv)); in s390x_ed25519_digestsign()
409 memcpy(param.ed448.priv + 64 - 57, edkey->privkey, 57); in s390x_ed448_digestsign()
/freebsd-14.2/crypto/openssl/apps/
H A Dx509.c261 EVP_PKEY *privkey = NULL, *CAkey = NULL, *pubkey = NULL; in x509_main() local
631 if (privkey == NULL) in x509_main()
761 if ((pubkey != NULL || privkey != NULL || req != NULL) in x509_main()
763 privkey != NULL ? privkey : in x509_main()
822 if (reqfile || newcert || privkey != NULL || CAfile != NULL) { in x509_main()
832 if (!X509V3_set_issuer_pkey(&ext_ctx, privkey)) in x509_main()
853 if (privkey == NULL) { in x509_main()
871 if (!do_X509_REQ_sign(rq, privkey, digest, sigopts)) in x509_main()
887 } else if (privkey != NULL) { in x509_main()
888 if (!do_X509_sign(x, privkey, digest, sigopts, &ext_ctx)) in x509_main()
[all …]

123