| /freebsd-12.1/crypto/openssl/crypto/ec/ |
| H A D | ecx_meth.c | 50 unsigned char *privkey, *pubkey; in ecx_key_op() local 75 pubkey = key->pubkey; in ecx_key_op() 78 memcpy(pubkey, p, plen); in ecx_key_op() 110 X448_public_from_private(pubkey, privkey); in ecx_key_op() 113 ED448_public_from_private(pubkey, privkey); in ecx_key_op() 170 return CRYPTO_memcmp(akey->pubkey, bkey->pubkey, KEYLEN(a)) == 0; in ecx_pub_cmp() 404 memcpy(pub, key->pubkey, *len); in ecx_get_pub_key() 679 *pubkey = peerkey->pubkey; in validate_ecx_derive() 687 const unsigned char *privkey, *pubkey; in pkey_ecx_derive25519() local 700 const unsigned char *privkey, *pubkey; in pkey_ecx_derive448() local [all …]
|
| H A D | ec_ameth.c | 136 static int eckey_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) in eckey_pub_decode() argument 144 if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey)) in eckey_pub_decode() 667 plen = ASN1_STRING_length(pubkey); in ecdh_cms_set_peerkey() 668 p = ASN1_STRING_get0_data(pubkey); in ecdh_cms_set_peerkey() 787 ASN1_BIT_STRING *pubkey; in ecdh_cms_decrypt() local 791 if (!alg || !pubkey) in ecdh_cms_decrypt() 793 if (!ecdh_cms_set_peerkey(pctx, alg, pubkey)) { in ecdh_cms_decrypt() 814 ASN1_BIT_STRING *pubkey; in ecdh_cms_encrypt() local 848 ASN1_STRING_set0(pubkey, penc, penclen); in ecdh_cms_encrypt() 849 pubkey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); in ecdh_cms_encrypt() [all …]
|
| /freebsd-12.1/contrib/unbound/validator/ |
| H A D | val_secalgo.c | 1139 if(!*pubkey) { in nss_setup_key_digest() 1158 if(!*pubkey) { in nss_setup_key_digest() 1195 if(!*pubkey) { in nss_setup_key_digest() 1208 if(!*pubkey) { in nss_setup_key_digest() 1218 if(!*pubkey) { in nss_setup_key_digest() 1258 SECKEYPublicKey* pubkey = NULL; in verify_canonrrset() local 1328 SECKEY_DestroyPublicKey(pubkey); in verify_canonrrset() 1557 struct dsa_public_key pubkey; in _verify_nettle_dsa() local 1644 struct rsa_public_key pubkey; in _verify_nettle_rsa() local 1674 nettle_mpz_set_str_256_u(pubkey.n, pubkey.size, &key[mod_offset]); in _verify_nettle_rsa() [all …]
|
| /freebsd-12.1/contrib/wpa/src/crypto/ |
| H A D | crypto_internal-modexp.c | 17 u8 *pubkey) in crypto_dh_init() argument 30 pubkey, &pubkey_len) < 0) in crypto_dh_init() 34 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init() 35 os_memset(pubkey, 0, pad); in crypto_dh_init() 45 const u8 *pubkey, size_t pubkey_len, in crypto_dh_derive_secret() argument 53 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret() 57 if (!pub || bignum_set_unsigned_bin(pub, pubkey, pubkey_len) < 0 || in crypto_dh_derive_secret() 81 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
|
| H A D | crypto_nettle.c | 308 u8 *pubkey) in crypto_dh_init() argument 321 pubkey, &pubkey_len) < 0) in crypto_dh_init() 325 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init() 326 os_memset(pubkey, 0, pad); in crypto_dh_init() 336 const u8 *pubkey, size_t pubkey_len, in crypto_dh_derive_secret() argument 344 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret() 348 mpz_import(pub, pubkey_len, 1, 1, 1, 0, pubkey); in crypto_dh_derive_secret() 367 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
|
| H A D | crypto_wolfssl.c | 646 struct wpabuf *pubkey = NULL; in dh5_init() local 665 if (!privkey || !pubkey) in dh5_init() 678 wpabuf_put(pubkey, pub_sz); in dh5_init() 682 *publ = pubkey; in dh5_init() 685 pubkey = NULL; in dh5_init() 687 wpabuf_clear_free(pubkey); in dh5_init() 779 u8 *pubkey) in crypto_dh_init() argument 816 os_memmove(pubkey + pad_sz, pubkey, pub_sz); in crypto_dh_init() 817 os_memset(pubkey, 0, pad_sz); in crypto_dh_init() 1747 if (!pubkey) in crypto_ecdh_set_peerkey() [all …]
|
| H A D | crypto_gnutls.c | 287 u8 *pubkey) in crypto_dh_init() argument 300 pubkey, &pubkey_len) < 0) in crypto_dh_init() 304 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init() 305 os_memset(pubkey, 0, pad); in crypto_dh_init() 315 const u8 *pubkey, size_t pubkey_len, in crypto_dh_derive_secret() argument 323 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret() 326 if (gcry_mpi_scan(&pub, GCRYMPI_FMT_USG, pubkey, pubkey_len, NULL) != in crypto_dh_derive_secret() 353 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
|
| H A D | crypto_openssl.c | 521 u8 *pubkey) in crypto_dh_init() argument 538 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init() 539 os_memset(pubkey, 0, pad); in crypto_dh_init() 781 if (pubkey == NULL) in dh5_init() 792 *publ = pubkey; in dh5_init() 796 wpabuf_clear_free(pubkey); in dh5_init() 831 if (!pubkey) in dh5_init() 842 *publ = pubkey; in dh5_init() 849 wpabuf_clear_free(pubkey); in dh5_init() 1938 const EC_POINT *pubkey; in crypto_ecdh_get_pubkey() local [all …]
|
| H A D | crypto_libtomcrypt.c | 701 u8 *pubkey) in crypto_dh_init() argument 714 pubkey, &pubkey_len) < 0) in crypto_dh_init() 718 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init() 719 os_memset(pubkey, 0, pad); in crypto_dh_init() 729 const u8 *pubkey, size_t pubkey_len, in crypto_dh_derive_secret() argument 733 return crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
|
| /freebsd-12.1/contrib/wpa/src/wps/ |
| H A D | wps_attr_build.c | 23 struct wpabuf *pubkey = NULL; in wps_build_public_key() local 39 pubkey = wpabuf_dup(wps->wps->dh_pubkey); in wps_build_public_key() 63 if (wps->dh_privkey && pubkey) in wps_build_public_key() 70 pubkey = wpabuf_zeropad(pubkey, 192); in wps_build_public_key() 75 wpabuf_free(pubkey); in wps_build_public_key() 82 wpabuf_put_be16(msg, wpabuf_len(pubkey)); in wps_build_public_key() 83 wpabuf_put_buf(msg, pubkey); in wps_build_public_key() 87 wps->dh_pubkey_r = pubkey; in wps_build_public_key() 90 wps->dh_pubkey_e = pubkey; in wps_build_public_key() 424 addr[0] = wpabuf_head(pubkey); in wps_build_oob_dev_pw() [all …]
|
| H A D | wps_common.c | 64 struct wpabuf *pubkey, *dh_shared; in wps_derive_keys() local 75 pubkey = wps->registrar ? wps->dh_pubkey_e : wps->dh_pubkey_r; in wps_derive_keys() 76 if (pubkey == NULL) { in wps_derive_keys() 413 const struct wpabuf *pubkey, in wps_build_nfc_pw_token() argument 422 if (wps_build_oob_dev_pw(data, dev_pw_id, pubkey, in wps_build_nfc_pw_token() 629 if (pubkey == NULL || dev_pw == NULL) in wps_nfc_token_build() 632 ret = wps_build_nfc_pw_token(id, pubkey, dev_pw); in wps_nfc_token_build() 663 wpabuf_free(*pubkey); in wps_nfc_gen_dh() 664 *pubkey = pub; in wps_nfc_gen_dh() 690 if (wps_nfc_gen_dh(pubkey, privkey) < 0) { in wps_nfc_token_gen() [all …]
|
| /freebsd-12.1/crypto/openssl/crypto/x509v3/ |
| H A D | v3_skey.c | 59 X509_PUBKEY *pubkey; in s2i_skey_id() local 82 pubkey = ctx->subject_req->req_info.pubkey; in s2i_skey_id() 84 pubkey = ctx->subject_cert->cert_info.key; in s2i_skey_id() 86 if (pubkey == NULL) { in s2i_skey_id() 91 X509_PUBKEY_get0_param(NULL, &pk, &pklen, NULL, pubkey); in s2i_skey_id()
|
| /freebsd-12.1/crypto/openssl/crypto/ec/curve448/ |
| H A D | eddsa.c | 84 uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], in c448_ed448_derive_public_key() 115 curve448_point_mul_by_ratio_and_encode_like_eddsa(pubkey, p); in c448_ed448_derive_public_key() 128 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], in c448_ed448_sign() 202 || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES) in c448_ed448_sign() 233 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], in c448_ed448_sign_prehash() 237 return c448_ed448_sign(signature, privkey, pubkey, hash, 64, 1, context, in c448_ed448_sign_prehash() 243 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], in c448_ed448_verify() 278 curve448_point_decode_like_eddsa_and_mul_by_ratio(pk_point, pubkey); in c448_ed448_verify() 297 || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES) in c448_ed448_verify() 325 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], in c448_ed448_verify_prehash() [all …]
|
| H A D | ed448.h | 41 uint8_t pubkey [EDDSA_448_PUBLIC_BYTES], 64 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], 88 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], 114 pubkey[EDDSA_448_PUBLIC_BYTES], 138 const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES],
|
| /freebsd-12.1/crypto/openssl/crypto/x509/ |
| H A D | x509_r2x.c | 25 EVP_PKEY *pubkey = NULL; in X509_REQ_to_X509() local 56 pubkey = X509_REQ_get0_pubkey(r); in X509_REQ_to_X509() 57 if (pubkey == NULL || !X509_set_pubkey(ret, pubkey)) in X509_REQ_to_X509()
|
| H A D | x_pubkey.c | 33 X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval; in pubkey_cb() local 34 EVP_PKEY_free(pubkey->pkey); in pubkey_cb() 37 X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval; in pubkey_cb() local 38 EVP_PKEY_free(pubkey->pkey); in pubkey_cb() 39 pubkey->pkey = NULL; in pubkey_cb() 46 if (x509_pubkey_decode(&pubkey->pkey, pubkey) == -1) in pubkey_cb()
|
| /freebsd-12.1/sbin/dumpon/ |
| H A D | dumpon.c | 218 RSA *pubkey; in genkey() local 224 pubkey = NULL; in genkey() 233 pubkey = RSA_new(); in genkey() 234 if (pubkey == NULL) { in genkey() 239 pubkey = PEM_read_RSA_PUBKEY(fp, &pubkey, NULL, NULL); in genkey() 242 if (pubkey == NULL) in genkey() 245 kdap->kda_encryptedkeysize = RSA_size(pubkey); in genkey() 258 kdap->kda_encryptedkey, pubkey, in genkey() 262 RSA_free(pubkey); in genkey()
|
| /freebsd-12.1/contrib/ldns/ |
| H A D | keys.c | 1823 ldns_rr *pubkey; in ldns_key2rr() local 1841 pubkey = ldns_rr_new(); in ldns_key2rr() 1850 ldns_rr_set_type(pubkey, LDNS_RR_TYPE_KEY); in ldns_key2rr() 1857 ldns_rr_push_rdf(pubkey, in ldns_key2rr() 1861 ldns_rr_push_rdf(pubkey, in ldns_key2rr() 1875 ldns_rr_push_rdf(pubkey, in ldns_key2rr() 1897 ldns_rr_push_rdf(pubkey, in ldns_key2rr() 1920 ldns_rr_push_rdf(pubkey, in ldns_key2rr() 2047 ldns_rr_push_rdf(pubkey, in ldns_key2rr() 2059 ldns_rr_push_rdf(pubkey, keybin); in ldns_key2rr() [all …]
|
| /freebsd-12.1/crypto/openssl/crypto/ct/ |
| H A D | ct_sct_ctx.c | 238 int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_issuer_pubkey() argument 240 return ct_public_key_hash(pubkey, &sctx->ihash, &sctx->ihashlen); in SCT_CTX_set1_issuer_pubkey() 243 int SCT_CTX_set1_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_pubkey() argument 245 EVP_PKEY *pkey = X509_PUBKEY_get(pubkey); in SCT_CTX_set1_pubkey() 250 if (!ct_public_key_hash(pubkey, &sctx->pkeyhash, &sctx->pkeyhashlen)) { in SCT_CTX_set1_pubkey()
|
| /freebsd-12.1/crypto/openssl/crypto/dh/ |
| H A D | dh_ameth.c | 45 static int dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) in dh_pub_decode() argument 57 if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey)) in dh_pub_decode() 639 plen = ASN1_STRING_length(pubkey); in dh_cms_set_peerkey() 640 p = ASN1_STRING_get0_data(pubkey); in dh_cms_set_peerkey() 755 ASN1_BIT_STRING *pubkey; in dh_cms_decrypt() local 759 if (!alg || !pubkey) in dh_cms_decrypt() 761 if (!dh_cms_set_peerkey(pctx, alg, pubkey)) { in dh_cms_decrypt() 782 ASN1_BIT_STRING *pubkey; in dh_cms_encrypt() local 811 ASN1_STRING_set0(pubkey, penc, penclen); in dh_cms_encrypt() 812 pubkey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); in dh_cms_encrypt() [all …]
|
| /freebsd-12.1/usr.sbin/pkg/ |
| H A D | pkg.c | 69 struct pubkey { struct 589 static struct pubkey * 592 struct pubkey *pk; in read_pubkey() 609 pk = calloc(1, sizeof(struct pubkey)); in read_pubkey() 693 struct pubkey *pk; in verify_pubsignature() 694 const char *pubkey; in verify_pubsignature() local 698 pubkey = NULL; in verify_pubsignature() 700 if (config_string(PUBKEY, &pubkey) != 0) { in verify_pubsignature() 711 printf("Verifying signature with public key %s... ", pubkey); in verify_pubsignature() 712 if (rsa_verify_cert(fd_pkg, pubkey, NULL, 0, pk->sig, in verify_pubsignature()
|
| /freebsd-12.1/crypto/openssl/ssl/ |
| H A D | ssl_rsa.c | 1048 EVP_PKEY *pubkey = NULL; in ssl_set_cert_and_key() local 1064 pubkey = X509_get_pubkey(x509); /* bumps reference */ in ssl_set_cert_and_key() 1065 if (pubkey == NULL) in ssl_set_cert_and_key() 1068 privatekey = pubkey; in ssl_set_cert_and_key() 1072 if (EVP_PKEY_missing_parameters(pubkey)) { in ssl_set_cert_and_key() 1078 EVP_PKEY_copy_parameters(privatekey, pubkey); in ssl_set_cert_and_key() 1080 } else if (EVP_PKEY_missing_parameters(pubkey)) { in ssl_set_cert_and_key() 1082 EVP_PKEY_copy_parameters(pubkey, privatekey); in ssl_set_cert_and_key() 1093 if (EVP_PKEY_cmp(pubkey, privatekey) != 1) { in ssl_set_cert_and_key() 1098 if (ssl_cert_lookup_by_pkey(pubkey, &i) == NULL) { in ssl_set_cert_and_key() [all …]
|
| /freebsd-12.1/crypto/openssl/apps/ |
| H A D | spkac.c | 61 int i, ret = 1, verify = 0, noout = 0, pubkey = 0; in spkac_main() local 87 pubkey = 1; in spkac_main() 189 if (pubkey) in spkac_main()
|
| /freebsd-12.1/crypto/openssl/crypto/asn1/ |
| H A D | t_spki.c | 28 X509_PUBKEY_get0_param(&spkioid, NULL, NULL, NULL, spki->spkac->pubkey); in NETSCAPE_SPKI_print() 32 pkey = X509_PUBKEY_get(spki->spkac->pubkey); in NETSCAPE_SPKI_print()
|
| /freebsd-12.1/crypto/openssl/crypto/cms/ |
| H A D | cms_kari.c | 53 ASN1_BIT_STRING **pubkey, in CMS_RecipientInfo_kari_get0_orig_id() argument 73 if (pubkey) in CMS_RecipientInfo_kari_get0_orig_id() 74 *pubkey = NULL; in CMS_RecipientInfo_kari_get0_orig_id() 86 if (pubkey) in CMS_RecipientInfo_kari_get0_orig_id() 87 *pubkey = oik->d.originatorKey->publicKey; in CMS_RecipientInfo_kari_get0_orig_id()
|