Home
last modified time | relevance | path

Searched refs:pubkey (Results 1 – 25 of 51) sorted by relevance

123

/dflybsd-src/contrib/wpa_supplicant/src/crypto/
H A Dcrypto_internal-modexp.c17 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 Dcrypto_wolfssl.c646 struct wpabuf *pubkey = NULL; in dh5_init() local
664 pubkey = wpabuf_alloc(RFC3526_LEN); in dh5_init()
665 if (!privkey || !pubkey) in dh5_init()
674 wpabuf_mhead(pubkey), &pub_sz) != 0) 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
802 if (wc_DhGenerateKeyPair(dh, &rng, privkey, &priv_sz, pubkey, &pub_sz) in crypto_dh_init()
[all …]
H A Dcrypto_nettle.c308 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 Dcrypto_gnutls.c287 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 Dcrypto_openssl.c521 u8 *pubkey) in crypto_dh_init() argument
534 pubkey, &pubkey_len) < 0) in crypto_dh_init()
538 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init()
539 os_memset(pubkey, 0, pad); in crypto_dh_init()
549 const u8 *pubkey, size_t pubkey_len, in crypto_dh_derive_secret() argument
555 pub = BN_bin2bn(pubkey, pubkey_len, NULL); in crypto_dh_derive_secret()
580 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
753 struct wpabuf *pubkey = NULL, *privkey = NULL; in dh5_init() local
780 pubkey = wpabuf_alloc(publen); in dh5_init()
781 if (pubkey == NULL) in dh5_init()
[all …]
H A Dcrypto_libtomcrypt.c701 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()
/dflybsd-src/contrib/wpa_supplicant/src/wps/
H A Dwps_attr_build.c23 struct wpabuf *pubkey = NULL; in wps_build_public_key() local
39 pubkey = wpabuf_dup(wps->wps->dh_pubkey); in wps_build_public_key()
62 pubkey = wpabuf_dup(wps->wps->ap_nfc_dh_pubkey); in wps_build_public_key()
63 if (wps->dh_privkey && pubkey) in wps_build_public_key()
64 wps->dh_ctx = dh5_init_fixed(wps->dh_privkey, pubkey); in wps_build_public_key()
69 wps->dh_ctx = dh5_init(&wps->dh_privkey, &pubkey); in wps_build_public_key()
70 pubkey = wpabuf_zeropad(pubkey, 192); in wps_build_public_key()
72 if (wps->dh_ctx == NULL || wps->dh_privkey == NULL || pubkey == NULL) { in wps_build_public_key()
75 wpabuf_free(pubkey); in wps_build_public_key()
79 wpa_hexdump_buf(MSG_DEBUG, "WPS: DH own Public Key", pubkey); in wps_build_public_key()
[all …]
H A Dwps_common.c64 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()
82 wpa_hexdump_buf(MSG_DEBUG, "WPS: DH peer Public Key", pubkey); in wps_derive_keys()
83 dh_shared = dh5_derive_shared(wps->dh_ctx, pubkey, wps->dh_privkey); 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()
624 struct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey, in wps_nfc_token_build() argument
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()
[all …]
H A Dwps.h909 const u8 *addr, struct wpabuf *pubkey);
917 const struct wpabuf *pubkey,
919 struct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey,
921 int wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey);
922 struct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey,
/dflybsd-src/contrib/ldns/
H A Dkeys.c1810 ldns_rr *pubkey; in ldns_key2rr() local
1828 pubkey = ldns_rr_new(); in ldns_key2rr()
1837 ldns_rr_set_type(pubkey, LDNS_RR_TYPE_KEY); in ldns_key2rr()
1840 ldns_rr_set_type(pubkey, LDNS_RR_TYPE_DNSKEY); in ldns_key2rr()
1844 ldns_rr_push_rdf(pubkey, in ldns_key2rr()
1848 ldns_rr_push_rdf(pubkey, in ldns_key2rr()
1852 ldns_rr_set_owner(pubkey, ldns_rdf_clone(ldns_key_pubkey_owner(k))); in ldns_key2rr()
1862 ldns_rr_push_rdf(pubkey, in ldns_key2rr()
1869 ldns_rr_free(pubkey); in ldns_key2rr()
1874 ldns_rr_free(pubkey); in ldns_key2rr()
[all …]
/dflybsd-src/crypto/libressl/crypto/ct/
H A Dct_sct_ctx.c296 SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_issuer_pubkey() argument
298 return ct_public_key_hash(pubkey, &sctx->ihash, &sctx->ihashlen); in SCT_CTX_set1_issuer_pubkey()
302 SCT_CTX_set1_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey) in SCT_CTX_set1_pubkey() argument
304 EVP_PKEY *pkey = X509_PUBKEY_get(pubkey); in SCT_CTX_set1_pubkey()
309 if (!ct_public_key_hash(pubkey, &sctx->pkeyhash, &sctx->pkeyhashlen)) { in SCT_CTX_set1_pubkey()
H A Dct_local.h193 int SCT_CTX_set1_issuer_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey);
199 int SCT_CTX_set1_pubkey(SCT_CTX *sctx, X509_PUBKEY *pubkey);
/dflybsd-src/crypto/libressl/crypto/x509/
H A Dx509_r2x.c77 EVP_PKEY *pubkey; in X509_REQ_to_X509() local
106 if ((pubkey = X509_REQ_get0_pubkey(r)) == NULL) in X509_REQ_to_X509()
108 if (!X509_set_pubkey(ret, pubkey)) in X509_REQ_to_X509()
H A Dx509spki.c71 return (X509_PUBKEY_set(&(x->spkac->pubkey), pkey)); in NETSCAPE_SPKI_set_pubkey()
79 return (X509_PUBKEY_get(x->spkac->pubkey)); in NETSCAPE_SPKI_get_pubkey()
/dflybsd-src/crypto/libressl/crypto/ec/
H A Dec_ameth.c194 eckey_pub_decode(EVP_PKEY * pkey, X509_PUBKEY * pubkey) in eckey_pub_decode() argument
202 if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey)) in eckey_pub_decode()
682 ASN1_BIT_STRING *pubkey) in ecdh_cms_set_peerkey() argument
718 plen = ASN1_STRING_length(pubkey); in ecdh_cms_set_peerkey()
719 p = ASN1_STRING_get0_data(pubkey); in ecdh_cms_set_peerkey()
843 ASN1_BIT_STRING *pubkey; in ecdh_cms_decrypt() local
845 if (!CMS_RecipientInfo_kari_get0_orig_id(ri, &alg, &pubkey, in ecdh_cms_decrypt()
848 if (!alg || !pubkey) in ecdh_cms_decrypt()
850 if (!ecdh_cms_set_peerkey(pctx, alg, pubkey)) { in ecdh_cms_decrypt()
874 ASN1_BIT_STRING *pubkey; in ecdh_cms_encrypt() local
[all …]
H A Dec_pmeth.c215 const EC_POINT *pubkey = NULL; in pkey_ec_derive() local
231 pubkey = EC_KEY_get0_public_key(ctx->peerkey->pkey.ec); in pkey_ec_derive()
240 ret = ECDH_compute_key(key, outlen, pubkey, eckey, 0); in pkey_ec_derive()
/dflybsd-src/crypto/openssh/
H A Dauthfile.c177 struct sshkey *pubkey = NULL; in sshkey_load_pubkey_from_private() local
187 KEY_UNSPEC, &pubkey)) != 0) in sshkey_load_pubkey_from_private()
189 if ((r = sshkey_set_filename(pubkey, filename)) != 0) in sshkey_load_pubkey_from_private()
193 *pubkeyp = pubkey; in sshkey_load_pubkey_from_private()
194 pubkey = NULL; in sshkey_load_pubkey_from_private()
200 sshkey_free(pubkey); in sshkey_load_pubkey_from_private()
H A Dsshd.c1194 struct sshkey *pubkey; in main() local
1493 &pubkey, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR) in main()
1496 if (pubkey != NULL && key != NULL) { in main()
1497 if (!sshkey_equal(pubkey, key)) { in main()
1500 sshkey_free(pubkey); in main()
1501 pubkey = NULL; in main()
1504 if (pubkey == NULL && key != NULL) { in main()
1505 if ((r = sshkey_from_private(key, &pubkey)) != 0) in main()
1509 if (pubkey != NULL && (r = sshkey_check_rsa_length(pubkey, in main()
1512 sshkey_free(pubkey); in main()
[all …]
H A Dssh_api.c203 struct sshkey *pubkey = NULL; in ssh_add_hostkey() local
208 if ((r = sshkey_from_private(key, &pubkey)) != 0) in ssh_add_hostkey()
213 sshkey_free(pubkey); in ssh_add_hostkey()
220 k->key = pubkey; in ssh_add_hostkey()
580 struct sshkey *pubkey, u_char **signature, size_t *slen, in _ssh_host_key_sign() argument
H A Dssh-keygen.c700 EVP_PKEY *pubkey; in do_convert_from_pkcs8() local
705 if ((pubkey = PEM_read_PUBKEY(fp, NULL, NULL, NULL)) == NULL) { in do_convert_from_pkcs8()
710 switch (EVP_PKEY_base_id(pubkey)) { in do_convert_from_pkcs8()
715 (*k)->rsa = EVP_PKEY_get1_RSA(pubkey); in do_convert_from_pkcs8()
722 (*k)->dsa = EVP_PKEY_get1_DSA(pubkey); in do_convert_from_pkcs8()
730 (*k)->ecdsa = EVP_PKEY_get1_EC_KEY(pubkey); in do_convert_from_pkcs8()
736 EVP_PKEY_base_id(pubkey)); in do_convert_from_pkcs8()
738 EVP_PKEY_free(pubkey); in do_convert_from_pkcs8()
937 struct sshkey *privkey = NULL, *pubkey = NULL; in fingerprint_private() local
942 if ((r = sshkey_load_public(path, &pubkey, &comment)) != 0) in fingerprint_private()
[all …]
/dflybsd-src/crypto/libressl/crypto/cms/
H A Dcms_kari.c99 ASN1_BIT_STRING **pubkey, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, in CMS_RecipientInfo_kari_get0_orig_id() argument
117 if (pubkey) in CMS_RecipientInfo_kari_get0_orig_id()
118 *pubkey = NULL; in CMS_RecipientInfo_kari_get0_orig_id()
130 if (pubkey) in CMS_RecipientInfo_kari_get0_orig_id()
131 *pubkey = oik->d.originatorKey->publicKey; in CMS_RecipientInfo_kari_get0_orig_id()
/dflybsd-src/crypto/libressl/crypto/asn1/
H A Dt_spki.c87 i = OBJ_obj2nid(spki->spkac->pubkey->algor->algorithm); in NETSCAPE_SPKI_print()
90 pkey = X509_PUBKEY_get(spki->spkac->pubkey); in NETSCAPE_SPKI_print()
/dflybsd-src/crypto/libressl/apps/openssl/
H A Dspkac.c83 int pubkey; member
135 .opt.flag = &spkac_config.pubkey,
299 if (spkac_config.pubkey) in spkac_main()
H A Dreq.c159 int pubkey; member
448 .opt.flag = &req_config.pubkey,
988 EVP_PKEY *pubkey = pkey; in req_main() local
990 if (pubkey == NULL) in req_main()
991 pubkey = X509_REQ_get0_pubkey(req); in req_main()
992 if (pubkey == NULL) in req_main()
994 i = X509_REQ_verify(req, pubkey); in req_main()
1003 …ig.noout && !req_config.text && !req_config.modulus && !req_config.subject && !req_config.pubkey) { in req_main()
1020 if (req_config.pubkey) { in req_main()
/dflybsd-src/lib/libtelnet/
H A Drsaencpwd.c308 char chalkey[160], pubkey[128], *ptr; local
347 memmove(pubkey, ptr, pubkey_len);
352 r = init_rsa_encpwd(&token, user_passwd, challenge, challenge_len, pubkey);

123