Home
last modified time | relevance | path

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

1234

/netbsd-src/crypto/external/bsd/openssl/dist/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()
75 (void **)&ecx->privkey, ecx->keylen, in ossl_ecx_key_fromdata()
84 OPENSSL_secure_clear_free(ecx->privkey, privkeylen); in ossl_ecx_key_fromdata()
85 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
[all …]
H A Decx_meth.c107 if (ecxkey == NULL || ecxkey->privkey == NULL) { in ecx_priv_encode()
112 oct.data = ecxkey->privkey; in ecx_priv_encode()
175 if (ecxkey == NULL || ecxkey->privkey == NULL) { in ecx_key_print()
184 if (ASN1_buf_print(bp, ecxkey->privkey, KEYLEN(pkey), in ecx_key_print()
309 || key->privkey == NULL in ecx_get_priv_key()
314 memcpy(priv, key->privkey, *len); in ecx_get_priv_key()
367 if (key->privkey != NULL) { in ecx_pkey_export_to()
370 key->privkey, key->keylen)) in ecx_pkey_export_to()
726 const unsigned char **privkey, in validate_ecx_derive() argument
737 if (ecxkey == NULL || ecxkey->privkey == NULL) { in validate_ecx_derive()
[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()
/netbsd-src/crypto/external/bsd/openssl/dist/providers/implementations/keymgmt/
H A Decx_kmgmt.c138 ok = ok && key->privkey != NULL; in ecx_has()
173 const unsigned char *pa = key1->privkey; in ecx_match()
174 const unsigned char *pb = key2->privkey; in ecx_match()
221 && key->privkey != NULL in key_to_params()
224 key->privkey, key->keylen)) in key_to_params()
411 OPENSSL_clear_free(ecxkey->privkey, ecxkey->keylen); in ecx_set_params()
412 ecxkey->privkey = NULL; in ecx_set_params()
582 unsigned char *privkey; in ecx_gen() local
596 if ((privkey = ossl_ecx_key_allocate_privkey(key)) == NULL) { in ecx_gen()
600 if (RAND_priv_bytes_ex(gctx->libctx, privkey, key->keylen, 0) <= 0) in ecx_gen()
[all …]
/netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/ec/
H A Decx_meth.c50 unsigned char *privkey, *pubkey; in ecx_key_op() local
80 privkey = key->privkey = OPENSSL_secure_malloc(KEYLENID(id)); in ecx_key_op()
81 if (privkey == NULL) { in ecx_key_op()
86 if (RAND_priv_bytes(privkey, KEYLENID(id)) <= 0) { in ecx_key_op()
87 OPENSSL_secure_free(privkey); in ecx_key_op()
88 key->privkey = NULL; in ecx_key_op()
92 privkey[0] &= 248; in ecx_key_op()
93 privkey[X25519_KEYLEN - 1] &= 127; in ecx_key_op()
94 privkey[X25519_KEYLEN - 1] |= 64; in ecx_key_op()
96 privkey[0] &= 252; in ecx_key_op()
[all …]
/netbsd-src/crypto/external/bsd/openssl/dist/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,
/netbsd-src/external/bsd/wpa/dist/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()
/netbsd-src/crypto/external/bsd/openssl/dist/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()
649 if (RAND_bytes_ex(gctx->libctx, key->privkey, XOR_KEY_SIZE, 0) <= 0) { in xor_gen()
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()
[all …]
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 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 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()
/netbsd-src/usr.sbin/syslogd/
H A Dsign.c120 assert(GlobalSign.pubkey_b64 && GlobalSign.privkey && in sign_global_init()
162 EVP_PKEY *pubkey = NULL, *privkey = NULL; in sign_get_keys() local
180 if (!(privkey = SSL_get_privatekey(ssl))) { in sign_get_keys()
200 privkey = NULL; in sign_get_keys()
206 GlobalSign.privkey = privkey; in sign_get_keys()
231 if (!(privkey && pubkey)) { /* PKIX not available --> generate key */ in sign_get_keys()
236 if (!(privkey = EVP_PKEY_new())) { in sign_get_keys()
253 if (!EVP_PKEY_assign_DSA(privkey, dsa)) { in sign_get_keys()
258 GlobalSign.privkey = privkey; in sign_get_keys()
259 GlobalSign.pubkey = privkey; in sign_get_keys()
[all …]
/netbsd-src/crypto/external/bsd/openssl.old/dist/test/
H A Dcmsapitest.c11 static EVP_PKEY *privkey = NULL; variable
33 if (!TEST_true(CMS_decrypt(content, privkey, cert, NULL, outmsgbio, in test_encrypt_decrypt()
76 if (!TEST_true(PEM_read_bio_PrivateKey(privkeybio, &privkey, NULL, NULL))) { in setup_tests()
92 EVP_PKEY_free(privkey); in cleanup_tests()
H A Ddtlstest.c20 static char *privkey = NULL; variable
67 &sctx, &cctx, cert, privkey))) in test_dtls_unprocessed()
162 &sctx, &cctx, cert, privkey))) in test_dtls_drop_records()
273 &sctx, &cctx, cert, privkey))) in test_cookie()
305 &sctx, &cctx, cert, privkey))) in test_dtls_duplicate_records()
347 &sctx, &cctx, cert, privkey))) in test_swap_app_data()
421 || !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()
88 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
/netbsd-src/crypto/external/bsd/openssl/dist/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()
/netbsd-src/crypto/external/bsd/openssl/dist/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()
/netbsd-src/crypto/external/bsd/openssl.old/dist/test/recipes/
H A D20-test_dgst.t23 my $privkey = shift;
31 ok(run(app(['openssl', 'dgst', '-sign', $privkey,
36 ok(run(app(['openssl', 'dgst', '-prverify', $privkey,
/netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/ec/curve448/
H A Ded448.h42 const uint8_t privkey [EDDSA_448_PRIVATE_BYTES]);
63 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
87 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
H A Deddsa.c90 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES]) in c448_ed448_derive_public_key()
98 if (!oneshot_hash(secret_scalar_ser, sizeof(secret_scalar_ser), privkey, in c448_ed448_derive_public_key()
132 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in c448_ed448_sign()
156 if (!oneshot_hash(expanded, sizeof(expanded), privkey, in c448_ed448_sign()
237 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in c448_ed448_sign_prehash()
242 return c448_ed448_sign(signature, privkey, pubkey, hash, 64, 1, context, in c448_ed448_sign_prehash()
/netbsd-src/external/mpl/bind/dist/lib/dns/
H A Dopensslecdsa_link.c101 opensslecdsa_generate_public_key(const EC_GROUP *group, const BIGNUM *privkey) { in raw_key_to_ossl()
106 if (EC_POINT_mul(group, pubkey, privkey, NULL, NULL, NULL) != 1) { in raw_key_to_ossl()
287 BIGNUM *privkey = NULL; in opensslecdsa_sign()
300 privkey = BN_bin2bn(key, key_len, NULL); in opensslecdsa_sign()
301 if (privkey == NULL) { in opensslecdsa_sign()
304 if (!EC_KEY_set_private_key(eckey, privkey)) { in opensslecdsa_sign()
308 pubkey = opensslecdsa_generate_public_key(group, privkey); in opensslecdsa_sign()
340 BN_clear_free(privkey); in opensslecdsa_verify()
630 const BIGNUM *privkey = NULL; in opensslecdsa_isprivate()
638 privkey in opensslecdsa_isprivate()
834 const BIGNUM *privkey = NULL; opensslecdsa_tofile() local
837 BIGNUM *privkey = NULL; opensslecdsa_tofile() local
1090 BIGNUM *privkey = BN_bin2bn(priv->elements[privkey_index].data, load_privkey_from_privstruct() local
[all...]
/netbsd-src/crypto/external/bsd/openssl/dist/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],
/netbsd-src/crypto/external/bsd/openssl/dist/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()
/netbsd-src/crypto/external/bsd/openssl.old/dist/fuzz/
H A Dserver.c515 RSA *privkey; in FuzzerTestOneInput() local
544 privkey = d2i_RSAPrivateKey(NULL, &bufp, sizeof(kRSAPrivateKeyDER)); in FuzzerTestOneInput()
545 OPENSSL_assert(privkey != NULL); in FuzzerTestOneInput()
547 EVP_PKEY_assign_RSA(pkey, privkey); in FuzzerTestOneInput()

1234