Lines Matching refs:auth

55 				     struct dpp_authentication *auth);
74 struct dpp_authentication *auth = wpa_s->dpp_auth;
80 if (auth && auth->response_pending &&
81 dpp_notify_new_qr_code(auth, bi) == 1) {
86 MAC2STR(auth->peer_mac_addr), auth->curr_freq,
88 offchannel_send_action(wpa_s, auth->curr_freq,
89 auth->peer_mac_addr, wpa_s->own_addr,
91 wpabuf_head(auth->resp_msg),
92 wpabuf_len(auth->resp_msg),
192 struct dpp_authentication *auth = wpa_s->dpp_auth;
194 if (!auth || !auth->resp_msg)
201 MAC2STR(auth->peer_mac_addr), auth->curr_freq,
203 offchannel_send_action(wpa_s, auth->curr_freq, auth->peer_mac_addr,
205 wpabuf_head(auth->resp_msg),
206 wpabuf_len(auth->resp_msg),
213 struct dpp_authentication *auth = wpa_s->dpp_auth;
216 if (!auth || !auth->resp_msg)
223 auth->auth_resp_tries++;
224 if (auth->auth_resp_tries >= max_tries) {
295 struct dpp_authentication *auth = wpa_s->dpp_auth;
298 if (!auth || !auth->conn_status_requested)
370 struct dpp_authentication *auth = wpa_s->dpp_auth;
374 if (!auth || !auth->conn_status_requested)
376 auth->conn_status_requested = 0;
385 msg = dpp_build_conn_status_result(auth, result,
400 MAC2STR(auth->peer_mac_addr), auth->curr_freq,
402 offchannel_send_action(wpa_s, auth->curr_freq,
403 auth->peer_mac_addr, wpa_s->own_addr, broadcast,
409 auth->remove_on_tx_status = 1;
417 struct dpp_authentication *auth = wpa_s->dpp_auth;
419 if (auth && auth->conn_status_requested)
433 struct dpp_authentication *auth = wpa_s->dpp_auth;
450 if (auth->connect_on_tx_status) {
451 auth->connect_on_tx_status = 0;
455 if (auth->conn_status_requested) {
498 if (auth->waiting_auth_resp) {
505 if (auth->waiting_auth_conf) {
511 if (auth->waiting_auth_conf &&
512 auth->auth_resp_status == DPP_STATUS_OK) {
522 if (!is_broadcast_ether_addr(dst) && auth->waiting_auth_resp &&
526 auth->auth_req_ack = 1;
547 struct dpp_authentication *auth = wpa_s->dpp_auth;
552 if (!auth || !auth->waiting_auth_resp)
564 if (auth->auth_req_ack && diff_ms >= wait_time) {
572 dpp_auth_deinit(auth);
596 freq = auth->curr_freq;
597 if (auth->neg_freq > 0)
598 freq = auth->neg_freq;
613 struct dpp_authentication *auth = wpa_s->dpp_auth;
615 if (!auth || !auth->waiting_auth_conf)
622 dpp_auth_deinit(auth);
628 struct dpp_authentication *auth)
632 auth->config_obj_override =
635 auth->discovery_override =
638 auth->groups_override =
640 auth->ignore_netaccesskey_mismatch =
659 struct dpp_authentication *auth = wpa_s->dpp_auth;
665 if (!auth)
668 if (auth->freq_idx == 0)
671 if (auth->freq_idx >= auth->num_freq) {
672 auth->num_freq_iters++;
677 if (auth->num_freq_iters >= max_tries || auth->auth_req_ack) {
688 auth->freq_idx = 0;
709 freq = auth->freq[auth->freq_idx++];
710 auth->curr_freq = freq;
712 if (!is_zero_ether_addr(auth->peer_mac_addr))
713 dst = auth->peer_mac_addr;
714 else if (is_zero_ether_addr(auth->peer_bi->mac_addr))
717 dst = auth->peer_bi->mac_addr;
730 if (auth->neg_freq > 0 && freq != auth->neg_freq) {
733 freq, auth->neg_freq);
737 auth->auth_req_ack = 0;
741 wpabuf_head(auth->req_msg),
742 wpabuf_len(auth->req_msg),
751 struct dpp_authentication *auth;
858 auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, own_bi, allowed_roles,
860 if (!auth)
862 wpas_dpp_set_testing_options(wpa_s, auth);
863 if (dpp_set_configurator(auth, cmd) < 0) {
864 dpp_auth_deinit(auth);
868 auth->neg_freq = neg_freq;
871 os_memcpy(auth->peer_mac_addr, peer_bi->mac_addr, ETH_ALEN);
875 return dpp_tcp_init(wpa_s->dpp, auth, &ipaddr, tcp_port,
880 wpa_s->dpp_auth = auth;
1172 struct dpp_authentication *auth,
1240 if (auth->net_access_key) {
1242 os_malloc(wpabuf_len(auth->net_access_key));
1246 wpabuf_head(auth->net_access_key),
1247 wpabuf_len(auth->net_access_key));
1248 ssid->dpp_netaccesskey_len = wpabuf_len(auth->net_access_key);
1249 ssid->dpp_netaccesskey_expiry = auth->net_access_key_expiry;
1328 if (auth->priv_key) {
1339 blob->len = wpabuf_len(auth->priv_key);
1346 os_memcpy(blob->data, wpabuf_head(auth->priv_key),
1383 struct dpp_authentication *auth,
1391 ssid = wpas_dpp_add_network(wpa_s, auth, conf);
1410 struct dpp_authentication *auth)
1413 if (auth->reconfig && wpa_s->dpp_reconfig_ssid &&
1430 if (auth->peer_version >= 2) {
1433 auth->connect_on_tx_status = 1;
1443 struct dpp_authentication *auth,
1508 if (auth->net_access_key) {
1512 hexlen = 2 * wpabuf_len(auth->net_access_key) + 1;
1516 wpabuf_head(auth->net_access_key),
1517 wpabuf_len(auth->net_access_key));
1518 if (auth->net_access_key_expiry)
1522 auth->net_access_key_expiry);
1556 return wpas_dpp_process_config(wpa_s, auth, conf);
1591 struct dpp_authentication *auth = wpa_s->dpp_auth;
1593 if (!auth || !auth->csrattrs)
1597 wpabuf_free(auth->csr);
1599 auth->csr = dpp_build_csr(auth, wpa_s->conf->dpp_name ?
1601 if (!auth->csr) {
1619 struct dpp_authentication *auth = wpa_s->dpp_auth;
1626 if (!auth || (!auth->auth_success && !auth->reconfig_success) ||
1627 os_memcmp(addr, auth->peer_mac_addr, ETH_ALEN) != 0) {
1656 res = dpp_conf_resp_rx(auth, resp);
1670 for (i = 0; i < auth->num_conf_obj; i++) {
1671 res = wpas_dpp_handle_config_obj(wpa_s, auth,
1672 &auth->conf_obj[i]);
1676 if (auth->num_conf_obj)
1677 wpas_dpp_post_process_config(wpa_s, auth);
1678 if (wpas_dpp_handle_key_pkg(wpa_s, auth->conf_key_pkg) < 0)
1692 if (auth->peer_version >= 2 &&
1693 auth->conf_resp_status == DPP_STATUS_OK) {
1697 msg = dpp_build_conf_result(auth, status);
1703 MAC2STR(addr), auth->curr_freq,
1705 offchannel_send_action(wpa_s, auth->curr_freq,
1715 auth->remove_on_tx_status = 1;
1727 struct dpp_authentication *auth = wpa_s->dpp_auth;
1737 buf = dpp_build_conf_req_helper(auth, wpa_s->conf->dpp_name,
1749 MAC2STR(auth->peer_mac_addr), auth->curr_freq);
1751 res = gas_query_req(wpa_s->gas, auth->peer_mac_addr, auth->curr_freq,
1791 struct dpp_authentication *auth = wpa_s->dpp_auth;
1797 if (!auth) {
1803 if (!is_zero_ether_addr(auth->peer_mac_addr) &&
1804 os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
1806 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
1812 if (auth->curr_freq != freq && auth->neg_freq == freq) {
1815 auth->curr_freq = freq;
1819 msg = dpp_auth_resp_rx(auth, hdr, buf, len);
1821 if (auth->auth_resp_status == DPP_STATUS_RESPONSE_PENDING) {
1825 wpas_dpp_listen_start(wpa_s, auth->curr_freq);
1831 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN);
1834 MAC2STR(src), auth->curr_freq, DPP_PA_AUTHENTICATION_CONF);
1835 offchannel_send_action(wpa_s, auth->curr_freq,
1847 struct dpp_authentication *auth = wpa_s->dpp_auth;
1852 if (!auth) {
1858 if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
1860 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
1866 if (dpp_auth_conf_rx(auth, hdr, buf, len) < 0) {
1881 struct dpp_authentication *auth = wpa_s->dpp_auth;
1883 if (!auth || !auth->waiting_conf_result)
1889 dpp_auth_deinit(auth);
1898 struct dpp_authentication *auth = wpa_s->dpp_auth;
1900 if (!auth || !auth->waiting_conn_status_result)
1907 dpp_auth_deinit(auth);
1915 struct dpp_authentication *auth = wpa_s->dpp_auth;
1921 if (!auth || !auth->waiting_conf_result) {
1922 if (auth &&
1923 os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) == 0 &&
1925 auth->gas_server_ctx)) {
1932 auth->waiting_conf_result = 1;
1940 if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
1942 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
1946 status = dpp_conf_result_rx(auth, hdr, buf, len);
1948 if (status == DPP_STATUS_OK && auth->send_conn_status) {
1954 auth->waiting_conn_status_result = 1;
1961 wpas_dpp_listen_start(wpa_s, auth->neg_freq ? auth->neg_freq :
1962 auth->curr_freq);
1971 dpp_auth_deinit(auth);
1981 struct dpp_authentication *auth = wpa_s->dpp_auth;
1989 if (!auth || !auth->waiting_conn_status_result) {
1995 status = dpp_conn_status_result_rx(auth, hdr, buf, len,
2004 dpp_auth_deinit(auth);
2012 struct dpp_authentication *auth)
2018 for (i = 0; i < auth->num_conf_obj; i++) {
2019 res = wpas_dpp_handle_config_obj(wpa_s, auth,
2020 &auth->conf_obj[i]);
2025 wpas_dpp_post_process_config(wpa_s, auth);
2048 struct dpp_authentication *auth;
2080 auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, NULL,
2082 if (!auth)
2084 wpas_dpp_set_testing_options(wpa_s, auth);
2085 if (dpp_set_configurator(auth, wpa_s->dpp_configurator_params) < 0) {
2086 dpp_auth_deinit(auth);
2090 auth->neg_freq = freq;
2094 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN);
2096 wpa_s->dpp_auth = auth;
2108 struct dpp_authentication *auth = wpa_s->dpp_auth;
2110 if (!auth)
2116 dpp_auth_deinit(auth);
2129 struct dpp_authentication *auth;
2174 auth = dpp_reconfig_init(wpa_s->dpp, wpa_s, conf, freq, group,
2176 if (!auth)
2178 wpas_dpp_set_testing_options(wpa_s, auth);
2179 if (dpp_set_configurator(auth, wpa_s->dpp_configurator_params) < 0) {
2180 dpp_auth_deinit(auth);
2184 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN);
2185 wpa_s->dpp_auth = auth;
2205 wpabuf_head(auth->reconfig_req_msg),
2206 wpabuf_len(auth->reconfig_req_msg),
2220 struct dpp_authentication *auth;
2249 auth = dpp_reconfig_auth_req_rx(wpa_s->dpp, wpa_s, ssid->dpp_connector,
2254 if (!auth)
2256 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN);
2257 wpa_s->dpp_auth = auth;
2264 wpabuf_head(auth->reconfig_resp_msg),
2265 wpabuf_len(auth->reconfig_resp_msg),
2278 struct dpp_authentication *auth = wpa_s->dpp_auth;
2284 if (!auth || !auth->reconfig || !auth->configurator) {
2290 if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
2292 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
2296 conf = dpp_reconfig_auth_resp_rx(auth, hdr, buf, len);
2323 struct dpp_authentication *auth = wpa_s->dpp_auth;
2328 if (!auth || !auth->reconfig || auth->configurator) {
2334 if (os_memcmp(src, auth->peer_mac_addr, ETH_ALEN) != 0) {
2336 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr));
2340 if (dpp_reconfig_auth_conf_rx(auth, hdr, buf, len) < 0)
2967 struct dpp_authentication *auth = wpa_s->dpp_auth;
2972 if (!auth || (!auth->auth_success && !auth->reconfig_success) ||
2973 os_memcmp(sa, auth->peer_mac_addr, ETH_ALEN) != 0) {
2978 if (wpa_s->dpp_auth_ok_on_ack && auth->configurator) {
2994 resp = dpp_conf_req_rx(auth, query, query_len);
2997 if (!resp && auth->waiting_cert) {
2999 auth->cert_resp_ctx = resp_ctx;
3007 auth->conf_resp = resp;
3008 auth->gas_server_ctx = resp_ctx;
3017 struct dpp_authentication *auth = wpa_s->dpp_auth;
3019 if (!auth) {
3023 if (auth->conf_resp != resp) {
3032 if (auth->waiting_csr && ok) {
3045 if (ok && auth->peer_version >= 2 &&
3046 auth->conf_resp_status == DPP_STATUS_OK &&
3047 !auth->waiting_conf_result) {
3049 auth->waiting_conf_result = 1;
3050 auth->conf_resp = NULL;
3074 struct dpp_authentication *auth;
3078 auth = dpp_alloc_auth(wpa_s->dpp, wpa_s);
3079 if (!auth)
3083 wpas_dpp_set_testing_options(wpa_s, auth);
3084 if (dpp_set_configurator(auth, cmd) == 0 &&
3085 dpp_configurator_own_config(auth, curve, 0) == 0)
3086 ret = wpas_dpp_handle_config_obj(wpa_s, auth,
3087 &auth->conf_obj[0]);
3089 wpas_dpp_post_process_config(wpa_s, auth);
3091 dpp_auth_deinit(auth);
3890 struct dpp_authentication *auth, bool tcp)
3894 resp = dpp_build_conf_resp(auth, auth->e_nonce, auth->curve->nonce_len,
3895 auth->e_netrole, true);
3900 auth->conf_resp_tcp = resp;
3904 if (gas_server_set_resp(wpa_s->gas_server, auth->cert_resp_ctx,
3911 auth->conf_resp = resp;
3920 struct dpp_authentication *auth = wpa_s->dpp_auth;
3929 if (!auth || !auth->waiting_cert ||
3930 (auth->peer_bi &&
3931 (unsigned int) peer != auth->peer_bi->id)) {
3932 auth = dpp_controller_get_auth(wpa_s->dpp, peer);
3937 if (!auth || !auth->waiting_cert) {
3944 (!auth->peer_bi ||
3945 (unsigned int) peer != auth->peer_bi->id) &&
3946 (!auth->tmp_peer_bi ||
3947 (unsigned int) peer != auth->tmp_peer_bi->id)) {
3963 auth->force_conf_resp_status = atoi(value);
3964 return wpas_dpp_build_conf_resp(wpa_s, auth, tcp);
3968 os_free(auth->trusted_eap_server_name);
3969 auth->trusted_eap_server_name = os_strdup(value);
3970 return auth->trusted_eap_server_name ? 0 : -1;
3980 wpabuf_free(auth->cacert);
3981 auth->cacert = buf;
3986 wpabuf_free(auth->certbag);
3987 auth->certbag = buf;
3988 return wpas_dpp_build_conf_resp(wpa_s, auth, tcp);