Home
last modified time | relevance | path

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

12

/hostap-latest/src/crypto/
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()
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()
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()
Dcrypto_wolfssl.c936 struct wpabuf *pubkey = NULL; in dh5_init() local
954 pubkey = wpabuf_alloc(RFC3526_LEN); in dh5_init()
955 if (!privkey || !pubkey) in dh5_init()
965 wpabuf_mhead(pubkey), &pub_sz) != 0) in dh5_init()
969 wpabuf_put(pubkey, pub_sz); in dh5_init()
973 *publ = pubkey; in dh5_init()
976 pubkey = NULL; in dh5_init()
978 wpabuf_clear_free(pubkey); in dh5_init()
1074 u8 *pubkey) in crypto_dh_init() argument
1098 if (wc_DhGenerateKeyPair(dh, &rng, privkey, &priv_sz, pubkey, &pub_sz) in crypto_dh_init()
[all …]
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()
Dcrypto_openssl.c741 u8 *pubkey) in crypto_dh_init() argument
754 pubkey, &pubkey_len) < 0) in crypto_dh_init()
758 os_memmove(pubkey + pad, pubkey, pubkey_len); in crypto_dh_init()
759 os_memset(pubkey, 0, pad); in crypto_dh_init()
769 const u8 *pubkey, size_t pubkey_len, in crypto_dh_derive_secret() argument
775 pub = BN_bin2bn(pubkey, pubkey_len, NULL); in crypto_dh_derive_secret()
800 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
971 struct wpabuf *pubkey = NULL, *privkey = NULL; in dh5_init() local
998 pubkey = wpabuf_alloc(publen); in dh5_init()
999 if (pubkey == NULL) in dh5_init()
[all …]
Dcrypto.h423 u8 *pubkey);
427 const u8 *pubkey, size_t pubkey_len,
Dcrypto_mbedtls_alt.c1448 …mbedtls_dhm_context *ctx, u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, u8 *pubkey) in crypto_mbedtls_dh_init_public() argument
1451 … mbedtls_dhm_make_public(ctx, (int)prime_len, pubkey, prime_len, hostap_rng_fn, hostap_rng_ctx())) in crypto_mbedtls_dh_init_public()
1457 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, u8 *pubkey) in crypto_dh_init() argument
1466 int ret = crypto_mbedtls_dh_init_public(&ctx, generator, prime, prime_len, privkey, pubkey); in crypto_dh_init()
1480 const u8 *pubkey, in crypto_dh_derive_secret() argument
1507 os_memcpy(p + 5, pubkey, pubkey_len); in crypto_dh_derive_secret()
/hostap-latest/src/wps/
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 …]
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 …]
Dwps.h927 const u8 *addr, struct wpabuf *pubkey);
935 const struct wpabuf *pubkey,
937 struct wpabuf * wps_nfc_token_build(int ndef, int id, struct wpabuf *pubkey,
939 int wps_nfc_gen_dh(struct wpabuf **pubkey, struct wpabuf **privkey);
940 struct wpabuf * wps_nfc_token_gen(int ndef, int *id, struct wpabuf **pubkey,
Dwps_i.h179 const struct wpabuf *pubkey, const u8 *dev_pw,
Dwps_er.c2083 const u8 *addr, struct wpabuf *pubkey) in wps_er_nfc_handover_sel() argument
2102 return wps_build_nfc_handover_sel(wps, pubkey, addr, 0); in wps_er_nfc_handover_sel()
/hostap-latest/src/pasn/
Dpasn_responder.c429 struct wpabuf *buf, *pubkey = NULL, *wrapped_data_buf = NULL; in handle_auth_pasn_resp() local
480 pubkey = crypto_ecdh_get_pubkey(pasn->ecdh, 0); in handle_auth_pasn_resp()
481 pubkey = wpabuf_zeropad(pubkey, in handle_auth_pasn_resp()
483 if (!pubkey) { in handle_auth_pasn_resp()
490 pubkey, true, NULL, 0); in handle_auth_pasn_resp()
497 wpabuf_free(pubkey); in handle_auth_pasn_resp()
498 pubkey = NULL; in handle_auth_pasn_resp()
591 wpabuf_free(pubkey); in handle_auth_pasn_resp()
699 if (!pasn_params.pubkey || !pasn_params.pubkey_len) { in handle_auth_pasn_1()
735 if (pasn_params.pubkey[0] == WPA_PASN_PUBKEY_UNCOMPRESSED) { in handle_auth_pasn_1()
[all …]
Dpasn_initiator.c525 struct wpabuf *buf, *pubkey = NULL, *wrapped_data_buf = NULL; in wpas_pasn_build_auth_1() local
540 pubkey = crypto_ecdh_get_pubkey(pasn->ecdh, 0); in wpas_pasn_build_auth_1()
541 pubkey = wpabuf_zeropad(pubkey, crypto_ecdh_prime_len(pasn->ecdh)); in wpas_pasn_build_auth_1()
542 if (!pubkey) { in wpas_pasn_build_auth_1()
585 pubkey, true, comeback, -1); in wpas_pasn_build_auth_1()
606 wpabuf_free(pubkey); in wpas_pasn_build_auth_1()
613 wpabuf_free(pubkey); in wpas_pasn_build_auth_1()
1189 if (!pasn_params->pubkey || !pasn_params->pubkey_len) { in wpa_pasn_auth_rx()
1194 if (pasn_params->pubkey[0] == WPA_PASN_PUBKEY_UNCOMPRESSED) { in wpa_pasn_auth_rx()
1196 } else if (pasn_params->pubkey[0] == WPA_PASN_PUBKEY_COMPRESSED_0 || in wpa_pasn_auth_rx()
[all …]
/hostap-latest/src/common/
Dsae_pk.c444 wpabuf_free(pk->pubkey); in sae_deinit_pk()
502 pk->pubkey = crypto_ec_key_get_subject_public_key(pk->key); in sae_parse_pk()
503 if (!pk->pubkey) in sae_parse_pk()
547 const u8 *pubkey, size_t pubkey_len, u8 *hash) in sae_pk_hash_sig_data() argument
580 wpabuf_put_data(sig_data, pubkey, pubkey_len); in sae_pk_hash_sig_data()
645 wpabuf_len(pk->m), wpabuf_head(pk->pubkey), in sae_write_confirm_pk()
646 wpabuf_len(pk->pubkey), hash) < 0) in sae_write_confirm_pk()
658 need = 4 + wpabuf_len(pk->pubkey) + 3 + wpabuf_len(sig) + in sae_write_confirm_pk()
669 wpabuf_put_u8(buf, 2 + wpabuf_len(pk->pubkey)); in sae_write_confirm_pk()
672 wpabuf_put_buf(buf, pk->pubkey); in sae_write_confirm_pk()
Ddpp_crypto.c320 der = crypto_ec_key_get_subject_public_key(bi->pubkey); in dpp_bootstrap_key_hash()
348 bi->pubkey = dpp_set_keypair(&bi->curve, privkey, privkey_len); in dpp_keygen()
350 bi->pubkey = dpp_gen_keypair(bi->curve); in dpp_keygen()
351 if (!bi->pubkey) in dpp_keygen()
355 der = crypto_ec_key_get_subject_public_key(bi->pubkey); in dpp_keygen()
599 bi->pubkey = key; in dpp_get_subject_public_key()
905 auth->own_bi->pubkey, 0); in dpp_gen_r_auth()
908 brx = crypto_ec_key_get_pubkey_point(auth->peer_bi->pubkey, 0); in dpp_gen_r_auth()
915 auth->peer_bi->pubkey, 0); in dpp_gen_r_auth()
918 brx = crypto_ec_key_get_pubkey_point(auth->own_bi->pubkey, 0); in dpp_gen_r_auth()
[all …]
Ddpp_pkex.c833 if (dpp_ecdh(pkex->own_bi->pubkey, pkex->y, Jx, &Jx_len) < 0) in dpp_pkex_rx_exchange_resp()
840 A_pub = crypto_ec_key_get_pubkey_point(pkex->own_bi->pubkey, 0); in dpp_pkex_rx_exchange_resp()
1152 if (dpp_ecdh(pkex->own_bi->pubkey, pkex->x, Lx, &Lx_len) < 0) in dpp_pkex_rx_commit_reveal_req()
1159 B_pub = crypto_ec_key_get_pubkey_point(pkex->own_bi->pubkey, 0); in dpp_pkex_rx_commit_reveal_req()
1360 bi->pubkey = pkex->peer_bootstrap_key; in dpp_pkex_finish()
Dsae.h34 struct wpabuf *pubkey; /* DER encoded subjectPublicKey */ member
Dwpa_common.h639 const u8 *pubkey; member
796 const struct wpabuf *pubkey, bool compressed,
Dwpa_common.c3996 const struct wpabuf *pubkey, bool compressed, in wpa_pasn_add_parameter_ie() argument
4029 if (pubkey) { in wpa_pasn_add_parameter_ie()
4039 params->len += 2 + 1 + 1 + wpabuf_len(pubkey); in wpa_pasn_add_parameter_ie()
4048 wpabuf_put_u8(buf, wpabuf_len(pubkey) + 1); in wpa_pasn_add_parameter_ie()
4052 wpabuf_put_buf(buf, pubkey); in wpa_pasn_add_parameter_ie()
4264 pasn_params->pubkey = pos; in wpa_pasn_parse_parameter_ie()
Ddpp_auth.c775 pi = dpp_set_pubkey_point(own_bi->pubkey, i_proto, i_proto_len); in dpp_auth_req_rx()
782 if (dpp_ecdh(own_bi->pubkey, pi, auth->Mx, &secret_len) < 0) in dpp_auth_req_rx()
1241 if (dpp_ecdh(auth->own_protocol_key, auth->peer_bi->pubkey, in dpp_auth_init()
Ddpp.h180 struct crypto_ec_key *pubkey; member
Ddpp.c168 crypto_ec_key_deinit(info->pubkey); in dpp_bootstrap_info_free()
4752 crypto_ec_key_deinit(own_bi->pubkey); in dpp_nfc_update_bi_key()
4753 own_bi->pubkey = NULL; in dpp_nfc_update_bi_key()
/hostap-latest/tests/hwsim/
Dtest_ap_eap.py330 pubkey = prefix + ".cert-pub.pem"
334 "-out", pubkey])
336 "-inkey", pubkey, "-pubin", "-in", perm_id,
1181 pubkey = prefix + ".cert-pub.pem"
1185 "-out", pubkey])
1187 "-inkey", pubkey, "-pubin", "-in", perm_id,
1555 pubkey = prefix + ".cert-pub.pem"
1559 "-out", pubkey])
1561 "-inkey", pubkey, "-pubin", "-in", perm_id,

12