Lines Matching full:auth
58 struct dpp_authentication *auth);
59 static bool wpas_dpp_tcp_msg_sent(void *ctx, struct dpp_authentication *auth);
78 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_qr_code() local
84 if (auth && auth->response_pending && in wpas_dpp_qr_code()
85 dpp_notify_new_qr_code(auth, bi) == 1) { in wpas_dpp_qr_code()
90 MAC2STR(auth->peer_mac_addr), auth->curr_freq, in wpas_dpp_qr_code()
92 offchannel_send_action(wpa_s, auth->curr_freq, in wpas_dpp_qr_code()
93 auth->peer_mac_addr, wpa_s->own_addr, in wpas_dpp_qr_code()
95 wpabuf_head(auth->resp_msg), in wpas_dpp_qr_code()
96 wpabuf_len(auth->resp_msg), in wpas_dpp_qr_code()
196 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_auth_resp_retry_timeout() local
198 if (!auth || !auth->resp_msg) in wpas_dpp_auth_resp_retry_timeout()
205 MAC2STR(auth->peer_mac_addr), auth->curr_freq, in wpas_dpp_auth_resp_retry_timeout()
207 offchannel_send_action(wpa_s, auth->curr_freq, auth->peer_mac_addr, in wpas_dpp_auth_resp_retry_timeout()
209 wpabuf_head(auth->resp_msg), in wpas_dpp_auth_resp_retry_timeout()
210 wpabuf_len(auth->resp_msg), in wpas_dpp_auth_resp_retry_timeout()
217 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_auth_resp_retry() local
220 if (!auth || !auth->resp_msg) in wpas_dpp_auth_resp_retry()
227 auth->auth_resp_tries++; in wpas_dpp_auth_resp_retry()
228 if (auth->auth_resp_tries >= max_tries) { in wpas_dpp_auth_resp_retry()
305 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_conn_status_result_timeout() local
308 if ((!auth || !auth->conn_status_requested) && in wpas_dpp_conn_status_result_timeout()
381 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_send_conn_status_result() local
385 if ((!auth || !auth->conn_status_requested) && in wpas_dpp_send_conn_status_result()
397 if (!auth || !auth->conn_status_requested) { in wpas_dpp_send_conn_status_result()
408 auth->conn_status_requested = 0; in wpas_dpp_send_conn_status_result()
410 msg = dpp_build_conn_status_result(auth, result, in wpas_dpp_send_conn_status_result()
425 MAC2STR(auth->peer_mac_addr), auth->curr_freq, in wpas_dpp_send_conn_status_result()
427 offchannel_send_action(wpa_s, auth->curr_freq, in wpas_dpp_send_conn_status_result()
428 auth->peer_mac_addr, wpa_s->own_addr, broadcast, in wpas_dpp_send_conn_status_result()
434 auth->remove_on_tx_status = 1; in wpas_dpp_send_conn_status_result()
443 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_connected_timeout() local
445 if ((auth && auth->conn_status_requested) || in wpas_dpp_connected_timeout()
453 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_connected() local
455 if ((auth && auth->conn_status_requested) || in wpas_dpp_connected()
472 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_drv_wait_timeout() local
474 if (auth && auth->waiting_auth_resp) { in wpas_dpp_drv_wait_timeout()
489 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_neg_freq_timeout() local
491 if (!wpa_s->dpp_listen_on_tx_expire || !auth || !auth->neg_freq) in wpas_dpp_neg_freq_timeout()
496 auth->neg_freq); in wpas_dpp_neg_freq_timeout()
497 wpas_dpp_listen_start(wpa_s, auth->neg_freq); in wpas_dpp_neg_freq_timeout()
508 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_tx_status() local
525 if (auth->connect_on_tx_status) { in wpas_dpp_tx_status()
526 auth->connect_on_tx_status = 0; in wpas_dpp_tx_status()
530 if (auth->conn_status_requested) { in wpas_dpp_tx_status()
573 if (auth->waiting_auth_resp) { in wpas_dpp_tx_status()
585 if (auth->waiting_auth_conf) { in wpas_dpp_tx_status()
591 if (auth->waiting_auth_conf && in wpas_dpp_tx_status()
592 auth->auth_resp_status == DPP_STATUS_OK) { in wpas_dpp_tx_status()
593 /* Make sure we do not get stuck waiting for Auth Confirm in wpas_dpp_tx_status()
594 * indefinitely after successfully transmitted Auth Response to in wpas_dpp_tx_status()
602 if (!is_broadcast_ether_addr(dst) && auth->waiting_auth_resp && in wpas_dpp_tx_status()
606 auth->auth_req_ack = 1; in wpas_dpp_tx_status()
629 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_reply_wait_timeout() local
634 if (!auth || !auth->waiting_auth_resp) in wpas_dpp_reply_wait_timeout()
646 if (auth->auth_req_ack && diff_ms >= wait_time) { in wpas_dpp_reply_wait_timeout()
654 dpp_auth_deinit(auth); in wpas_dpp_reply_wait_timeout()
678 freq = auth->curr_freq; in wpas_dpp_reply_wait_timeout()
679 if (auth->neg_freq > 0) in wpas_dpp_reply_wait_timeout()
680 freq = auth->neg_freq; in wpas_dpp_reply_wait_timeout()
695 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_auth_conf_wait_timeout() local
697 if (!auth || !auth->waiting_auth_conf) in wpas_dpp_auth_conf_wait_timeout()
701 "DPP: Terminate authentication exchange due to Auth Confirm timeout"); in wpas_dpp_auth_conf_wait_timeout()
702 wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL "No Auth Confirm received"); in wpas_dpp_auth_conf_wait_timeout()
704 dpp_auth_deinit(auth); in wpas_dpp_auth_conf_wait_timeout()
710 struct dpp_authentication *auth) in wpas_dpp_set_testing_options() argument
714 auth->config_obj_override = in wpas_dpp_set_testing_options()
717 auth->discovery_override = in wpas_dpp_set_testing_options()
720 auth->groups_override = in wpas_dpp_set_testing_options()
722 auth->ignore_netaccesskey_mismatch = in wpas_dpp_set_testing_options()
741 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_auth_init_next() local
749 if (!auth) in wpas_dpp_auth_init_next()
752 if (auth->freq_idx == 0) in wpas_dpp_auth_init_next()
755 if (auth->freq_idx >= auth->num_freq) { in wpas_dpp_auth_init_next()
756 auth->num_freq_iters++; in wpas_dpp_auth_init_next()
761 if (auth->num_freq_iters >= max_tries || auth->auth_req_ack) { in wpas_dpp_auth_init_next()
772 auth->freq_idx = 0; in wpas_dpp_auth_init_next()
793 freq = auth->freq[auth->freq_idx++]; in wpas_dpp_auth_init_next()
794 auth->curr_freq = freq; in wpas_dpp_auth_init_next()
796 if (!is_zero_ether_addr(auth->peer_mac_addr)) in wpas_dpp_auth_init_next()
797 dst = auth->peer_mac_addr; in wpas_dpp_auth_init_next()
798 else if (is_zero_ether_addr(auth->peer_bi->mac_addr)) in wpas_dpp_auth_init_next()
801 dst = auth->peer_bi->mac_addr; in wpas_dpp_auth_init_next()
814 if (auth->neg_freq > 0 && freq != auth->neg_freq) { in wpas_dpp_auth_init_next()
817 freq, auth->neg_freq); in wpas_dpp_auth_init_next()
821 auth->auth_req_ack = 0; in wpas_dpp_auth_init_next()
825 wpabuf_head(auth->req_msg), in wpas_dpp_auth_init_next()
826 wpabuf_len(auth->req_msg), in wpas_dpp_auth_init_next()
835 struct dpp_authentication *auth; in wpas_dpp_auth_init() local
953 auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, own_bi, allowed_roles, in wpas_dpp_auth_init()
955 if (!auth) in wpas_dpp_auth_init()
957 wpas_dpp_set_testing_options(wpa_s, auth); in wpas_dpp_auth_init()
958 if (dpp_set_configurator(auth, cmd) < 0) { in wpas_dpp_auth_init()
959 dpp_auth_deinit(auth); in wpas_dpp_auth_init()
963 auth->neg_freq = neg_freq; in wpas_dpp_auth_init()
966 os_memcpy(auth->peer_mac_addr, peer_bi->mac_addr, ETH_ALEN); in wpas_dpp_auth_init()
970 return dpp_tcp_init(wpa_s->dpp, auth, &ipaddr, tcp_port, in wpas_dpp_auth_init()
979 wpa_s->dpp_auth = auth; in wpas_dpp_auth_init()
1149 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_tx_auth_resp() local
1151 if (!auth) in wpas_dpp_tx_auth_resp()
1155 MAC2STR(auth->peer_mac_addr), auth->curr_freq, in wpas_dpp_tx_auth_resp()
1157 offchannel_send_action(wpa_s, auth->curr_freq, in wpas_dpp_tx_auth_resp()
1158 auth->peer_mac_addr, wpa_s->own_addr, broadcast, in wpas_dpp_tx_auth_resp()
1159 wpabuf_head(auth->resp_msg), in wpas_dpp_tx_auth_resp()
1160 wpabuf_len(auth->resp_msg), in wpas_dpp_tx_auth_resp()
1169 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_tx_auth_resp_roc_timeout() local
1171 if (!auth || !wpa_s->dpp_tx_auth_resp_on_roc_stop) in wpas_dpp_tx_auth_resp_roc_timeout()
1332 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_tx_wait_expire() local
1335 if (wpa_s->dpp_listen_on_tx_expire && auth && auth->neg_freq) { in wpas_dpp_tx_wait_expire()
1338 auth->neg_freq); in wpas_dpp_tx_wait_expire()
1340 wpas_dpp_listen_start(wpa_s, auth->neg_freq); in wpas_dpp_tx_wait_expire()
1344 if (!wpa_s->dpp_gas_server || !auth) { in wpas_dpp_tx_wait_expire()
1345 if (auth && auth->waiting_auth_resp && in wpas_dpp_tx_wait_expire()
1358 freq = auth->neg_freq > 0 ? auth->neg_freq : auth->curr_freq; in wpas_dpp_tx_wait_expire()
1370 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_start_gas_server() local
1374 auth->curr_freq, auth->neg_freq, wpa_s->dpp_listen_freq, in wpas_dpp_start_gas_server()
1381 struct dpp_authentication *auth, in wpas_dpp_add_network() argument
1452 if (auth->net_access_key) { in wpas_dpp_add_network()
1454 os_malloc(wpabuf_len(auth->net_access_key)); in wpas_dpp_add_network()
1458 wpabuf_head(auth->net_access_key), in wpas_dpp_add_network()
1459 wpabuf_len(auth->net_access_key)); in wpas_dpp_add_network()
1460 ssid->dpp_netaccesskey_len = wpabuf_len(auth->net_access_key); in wpas_dpp_add_network()
1461 ssid->dpp_netaccesskey_expiry = auth->net_access_key_expiry; in wpas_dpp_add_network()
1543 if (auth->priv_key) { in wpas_dpp_add_network()
1554 blob->len = wpabuf_len(auth->priv_key); in wpas_dpp_add_network()
1561 os_memcpy(blob->data, wpabuf_head(auth->priv_key), in wpas_dpp_add_network()
1598 struct dpp_authentication *auth, in wpas_dpp_process_config() argument
1606 ssid = wpas_dpp_add_network(wpa_s, auth, conf); in wpas_dpp_process_config()
1625 struct dpp_authentication *auth) in wpas_dpp_post_process_config() argument
1628 if (auth->reconfig && wpa_s->dpp_reconfig_ssid && in wpas_dpp_post_process_config()
1645 if (auth->peer_version >= 2) { in wpas_dpp_post_process_config()
1648 auth->connect_on_tx_status = 1; in wpas_dpp_post_process_config()
1658 struct dpp_authentication *auth, in wpas_dpp_handle_config_obj() argument
1723 if (auth->net_access_key) { in wpas_dpp_handle_config_obj()
1727 hexlen = 2 * wpabuf_len(auth->net_access_key) + 1; in wpas_dpp_handle_config_obj()
1731 wpabuf_head(auth->net_access_key), in wpas_dpp_handle_config_obj()
1732 wpabuf_len(auth->net_access_key)); in wpas_dpp_handle_config_obj()
1733 if (auth->net_access_key_expiry) in wpas_dpp_handle_config_obj()
1737 auth->net_access_key_expiry); in wpas_dpp_handle_config_obj()
1779 return wpas_dpp_process_config(wpa_s, auth, conf); in wpas_dpp_handle_config_obj()
1814 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_build_csr() local
1816 if (!auth || !auth->csrattrs) in wpas_dpp_build_csr()
1820 wpabuf_free(auth->csr); in wpas_dpp_build_csr()
1822 auth->csr = dpp_build_csr(auth, wpa_s->conf->dpp_name ? in wpas_dpp_build_csr()
1824 if (!auth->csr) { in wpas_dpp_build_csr()
1839 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_build_new_key() local
1841 if (!auth || !auth->waiting_new_key) in wpas_dpp_build_new_key()
1857 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_gas_resp_cb() local
1865 if (!auth || (!auth->auth_success && !auth->reconfig_success) || in wpas_dpp_gas_resp_cb()
1866 !ether_addr_equal(addr, auth->peer_mac_addr)) { in wpas_dpp_gas_resp_cb()
1895 res = dpp_conf_resp_rx(auth, resp); in wpas_dpp_gas_resp_cb()
1917 for (i = 0; i < auth->num_conf_obj; i++) { in wpas_dpp_gas_resp_cb()
1918 res = wpas_dpp_handle_config_obj(wpa_s, auth, in wpas_dpp_gas_resp_cb()
1919 &auth->conf_obj[i]); in wpas_dpp_gas_resp_cb()
1923 if (auth->num_conf_obj) in wpas_dpp_gas_resp_cb()
1924 wpas_dpp_post_process_config(wpa_s, auth); in wpas_dpp_gas_resp_cb()
1925 if (wpas_dpp_handle_key_pkg(wpa_s, auth->conf_key_pkg) < 0) in wpas_dpp_gas_resp_cb()
1939 if (auth->peer_version >= 2 && in wpas_dpp_gas_resp_cb()
1940 auth->conf_resp_status == DPP_STATUS_OK) { in wpas_dpp_gas_resp_cb()
1944 msg = dpp_build_conf_result(auth, status); in wpas_dpp_gas_resp_cb()
1950 MAC2STR(addr), auth->curr_freq, in wpas_dpp_gas_resp_cb()
1952 offchannel_send_action(wpa_s, auth->curr_freq, in wpas_dpp_gas_resp_cb()
1962 auth->remove_on_tx_status = 1; in wpas_dpp_gas_resp_cb()
1975 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_gas_client_timeout() local
1977 if (!wpa_s->dpp_gas_client || !auth || in wpas_dpp_gas_client_timeout()
1978 (!auth->auth_success && !auth->reconfig_success)) in wpas_dpp_gas_client_timeout()
1990 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_start_gas_client() local
2004 buf = dpp_build_conf_req_helper(auth, wpa_s->conf->dpp_name, in wpas_dpp_start_gas_client()
2018 MAC2STR(auth->peer_mac_addr), auth->curr_freq); in wpas_dpp_start_gas_client()
2030 res = gas_query_req(wpa_s->gas, auth->peer_mac_addr, auth->curr_freq, in wpas_dpp_start_gas_client()
2070 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_rx_auth_resp() local
2076 if (!auth) { in wpas_dpp_rx_auth_resp()
2082 if (!is_zero_ether_addr(auth->peer_mac_addr) && in wpas_dpp_rx_auth_resp()
2083 !ether_addr_equal(src, auth->peer_mac_addr)) { in wpas_dpp_rx_auth_resp()
2085 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in wpas_dpp_rx_auth_resp()
2091 if (auth->curr_freq != freq && auth->neg_freq == freq) { in wpas_dpp_rx_auth_resp()
2094 auth->curr_freq = freq; in wpas_dpp_rx_auth_resp()
2098 msg = dpp_auth_resp_rx(auth, hdr, buf, len); in wpas_dpp_rx_auth_resp()
2100 if (auth->auth_resp_status == DPP_STATUS_RESPONSE_PENDING) { in wpas_dpp_rx_auth_resp()
2104 wpas_dpp_listen_start(wpa_s, auth->curr_freq); in wpas_dpp_rx_auth_resp()
2110 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in wpas_dpp_rx_auth_resp()
2113 MAC2STR(src), auth->curr_freq, DPP_PA_AUTHENTICATION_CONF); in wpas_dpp_rx_auth_resp()
2114 offchannel_send_action(wpa_s, auth->curr_freq, in wpas_dpp_rx_auth_resp()
2126 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_rx_auth_conf() local
2131 if (!auth) { in wpas_dpp_rx_auth_conf()
2137 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in wpas_dpp_rx_auth_conf()
2139 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in wpas_dpp_rx_auth_conf()
2145 if (dpp_auth_conf_rx(auth, hdr, buf, len) < 0) { in wpas_dpp_rx_auth_conf()
2160 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_config_result_wait_timeout() local
2162 if (!auth || !auth->waiting_conf_result) in wpas_dpp_config_result_wait_timeout()
2168 dpp_auth_deinit(auth); in wpas_dpp_config_result_wait_timeout()
2177 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_conn_status_result_wait_timeout() local
2179 if (!auth || !auth->waiting_conn_status_result) in wpas_dpp_conn_status_result_wait_timeout()
2186 dpp_auth_deinit(auth); in wpas_dpp_conn_status_result_wait_timeout()
2230 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_rx_conf_result() local
2236 if (!auth || !auth->waiting_conf_result) { in wpas_dpp_rx_conf_result()
2237 if (auth && in wpas_dpp_rx_conf_result()
2238 ether_addr_equal(src, auth->peer_mac_addr) && in wpas_dpp_rx_conf_result()
2240 auth->gas_server_ctx)) { in wpas_dpp_rx_conf_result()
2247 auth->waiting_conf_result = 1; in wpas_dpp_rx_conf_result()
2255 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in wpas_dpp_rx_conf_result()
2257 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in wpas_dpp_rx_conf_result()
2261 status = dpp_conf_result_rx(auth, hdr, buf, len); in wpas_dpp_rx_conf_result()
2263 if (status == DPP_STATUS_OK && auth->send_conn_status) { in wpas_dpp_rx_conf_result()
2268 auth->conf_resp_status); in wpas_dpp_rx_conf_result()
2272 auth->waiting_conn_status_result = 1; in wpas_dpp_rx_conf_result()
2279 freq = auth->neg_freq ? auth->neg_freq : auth->curr_freq; in wpas_dpp_rx_conf_result()
2289 auth->conf_resp_status); in wpas_dpp_rx_conf_result()
2292 dpp_auth_deinit(auth); in wpas_dpp_rx_conf_result()
2316 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_rx_conn_status_result() local
2324 if (!auth || !auth->waiting_conn_status_result) { in wpas_dpp_rx_conn_status_result()
2330 status = dpp_conn_status_result_rx(auth, hdr, buf, len, in wpas_dpp_rx_conn_status_result()
2339 dpp_auth_deinit(auth); in wpas_dpp_rx_conn_status_result()
2347 struct dpp_authentication *auth) in wpas_dpp_process_conf_obj() argument
2353 for (i = 0; i < auth->num_conf_obj; i++) { in wpas_dpp_process_conf_obj()
2354 res = wpas_dpp_handle_config_obj(wpa_s, auth, in wpas_dpp_process_conf_obj()
2355 &auth->conf_obj[i]); in wpas_dpp_process_conf_obj()
2360 wpas_dpp_post_process_config(wpa_s, auth); in wpas_dpp_process_conf_obj()
2366 static bool wpas_dpp_tcp_msg_sent(void *ctx, struct dpp_authentication *auth) in wpas_dpp_tcp_msg_sent() argument
2372 if (auth->connect_on_tx_status) { in wpas_dpp_tcp_msg_sent()
2373 auth->connect_on_tx_status = 0; in wpas_dpp_tcp_msg_sent()
2377 if (auth->conn_status_requested) { in wpas_dpp_tcp_msg_sent()
2411 struct dpp_authentication *auth; in wpas_dpp_rx_presence_announcement() local
2447 auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, NULL, in wpas_dpp_rx_presence_announcement()
2449 if (!auth) in wpas_dpp_rx_presence_announcement()
2451 wpas_dpp_set_testing_options(wpa_s, auth); in wpas_dpp_rx_presence_announcement()
2452 if (dpp_set_configurator(auth, wpa_s->dpp_configurator_params) < 0) { in wpas_dpp_rx_presence_announcement()
2453 dpp_auth_deinit(auth); in wpas_dpp_rx_presence_announcement()
2457 auth->neg_freq = freq; in wpas_dpp_rx_presence_announcement()
2461 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in wpas_dpp_rx_presence_announcement()
2470 wpa_s->dpp_auth = auth; in wpas_dpp_rx_presence_announcement()
2482 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_reconfig_reply_wait_timeout() local
2484 if (!auth) in wpas_dpp_reconfig_reply_wait_timeout()
2490 dpp_auth_deinit(auth); in wpas_dpp_reconfig_reply_wait_timeout()
2503 struct dpp_authentication *auth; in wpas_dpp_rx_reconfig_announcement() local
2548 auth = dpp_reconfig_init(wpa_s->dpp, wpa_s, conf, freq, group, in wpas_dpp_rx_reconfig_announcement()
2550 if (!auth) in wpas_dpp_rx_reconfig_announcement()
2552 wpas_dpp_set_testing_options(wpa_s, auth); in wpas_dpp_rx_reconfig_announcement()
2553 if (dpp_set_configurator(auth, wpa_s->dpp_configurator_params) < 0) { in wpas_dpp_rx_reconfig_announcement()
2554 dpp_auth_deinit(auth); in wpas_dpp_rx_reconfig_announcement()
2558 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in wpas_dpp_rx_reconfig_announcement()
2559 wpa_s->dpp_auth = auth; in wpas_dpp_rx_reconfig_announcement()
2579 wpabuf_head(auth->reconfig_req_msg), in wpas_dpp_rx_reconfig_announcement()
2580 wpabuf_len(auth->reconfig_req_msg), in wpas_dpp_rx_reconfig_announcement()
2594 struct dpp_authentication *auth; in wpas_dpp_rx_reconfig_auth_req() local
2623 auth = dpp_reconfig_auth_req_rx(wpa_s->dpp, wpa_s, ssid->dpp_connector, in wpas_dpp_rx_reconfig_auth_req()
2628 if (!auth) in wpas_dpp_rx_reconfig_auth_req()
2630 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in wpas_dpp_rx_reconfig_auth_req()
2631 wpa_s->dpp_auth = auth; in wpas_dpp_rx_reconfig_auth_req()
2638 wpabuf_head(auth->reconfig_resp_msg), in wpas_dpp_rx_reconfig_auth_req()
2639 wpabuf_len(auth->reconfig_resp_msg), in wpas_dpp_rx_reconfig_auth_req()
2652 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_rx_reconfig_auth_resp() local
2658 if (!auth || !auth->reconfig || !auth->configurator) { in wpas_dpp_rx_reconfig_auth_resp()
2664 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in wpas_dpp_rx_reconfig_auth_resp()
2666 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in wpas_dpp_rx_reconfig_auth_resp()
2670 conf = dpp_reconfig_auth_resp_rx(auth, hdr, buf, len); in wpas_dpp_rx_reconfig_auth_resp()
2697 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_rx_reconfig_auth_conf() local
2702 if (!auth || !auth->reconfig || auth->configurator) { in wpas_dpp_rx_reconfig_auth_conf()
2708 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in wpas_dpp_rx_reconfig_auth_conf()
2710 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in wpas_dpp_rx_reconfig_auth_conf()
2714 if (dpp_reconfig_auth_conf_rx(auth, hdr, buf, len) < 0) in wpas_dpp_rx_reconfig_auth_conf()
2963 struct dpp_authentication *auth; in wpas_dpp_pkex_done() local
3004 auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, own_bi, allowed_roles, in wpas_dpp_pkex_done()
3006 if (!auth) in wpas_dpp_pkex_done()
3009 wpas_dpp_set_testing_options(wpa_s, auth); in wpas_dpp_pkex_done()
3010 if (dpp_set_configurator(auth, cmd) < 0) { in wpas_dpp_pkex_done()
3011 dpp_auth_deinit(auth); in wpas_dpp_pkex_done()
3015 return dpp_tcp_auth(wpa_s->dpp, conn, auth, wpa_s->conf->dpp_name, in wpas_dpp_pkex_done()
4178 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_gas_initial_resp_timeout() local
4180 if (!auth || !auth->waiting_config || !auth->config_resp_ctx) in wpas_dpp_gas_initial_resp_timeout()
4185 gas_server_set_comeback_delay(wpa_s->gas_server, auth->config_resp_ctx, in wpas_dpp_gas_initial_resp_timeout()
4195 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_gas_req_handler() local
4200 if (!auth || (!auth->auth_success && !auth->reconfig_success) || in wpas_dpp_gas_req_handler()
4201 !ether_addr_equal(sa, auth->peer_mac_addr)) { in wpas_dpp_gas_req_handler()
4206 if (wpa_s->dpp_auth_ok_on_ack && auth->configurator) { in wpas_dpp_gas_req_handler()
4208 …"DPP: Have not received ACK for Auth Confirm yet - assume it was received based on this GAS reques… in wpas_dpp_gas_req_handler()
4213 dpp_notify_auth_success(auth, 1); in wpas_dpp_gas_req_handler()
4229 resp = dpp_conf_req_rx(auth, query, query_len); in wpas_dpp_gas_req_handler()
4231 auth->gas_server_ctx = resp_ctx; in wpas_dpp_gas_req_handler()
4234 if (!resp && auth->waiting_cert) { in wpas_dpp_gas_req_handler()
4236 auth->config_resp_ctx = resp_ctx; in wpas_dpp_gas_req_handler()
4242 if (!resp && auth->waiting_config && in wpas_dpp_gas_req_handler()
4243 (auth->peer_bi || auth->tmp_peer_bi)) { in wpas_dpp_gas_req_handler()
4246 int i, res, *opclass = auth->e_band_support; in wpas_dpp_gas_req_handler()
4250 auth->config_resp_ctx = resp_ctx; in wpas_dpp_gas_req_handler()
4252 if (auth->e_name) { in wpas_dpp_gas_req_handler()
4253 size_t len = os_strlen(auth->e_name); in wpas_dpp_gas_req_handler()
4258 (const u8 *) auth->e_name, len); in wpas_dpp_gas_req_handler()
4274 if (auth->e_mud_url) { in wpas_dpp_gas_req_handler()
4275 size_t len = os_strlen(auth->e_mud_url); in wpas_dpp_gas_req_handler()
4277 if (!has_ctrl_char((const u8 *) auth->e_mud_url, len)) in wpas_dpp_gas_req_handler()
4278 mud_url = auth->e_mud_url; in wpas_dpp_gas_req_handler()
4282 auth->peer_bi ? auth->peer_bi->id : in wpas_dpp_gas_req_handler()
4283 auth->tmp_peer_bi->id, MAC2STR(sa), in wpas_dpp_gas_req_handler()
4284 dpp_netrole_str(auth->e_netrole), name, band, mud_url); in wpas_dpp_gas_req_handler()
4295 auth->conf_resp = resp; in wpas_dpp_gas_req_handler()
4309 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_gas_status_handler() local
4311 if (!auth) { in wpas_dpp_gas_status_handler()
4315 if (auth->conf_resp != resp) { in wpas_dpp_gas_status_handler()
4324 if (auth->waiting_csr && ok) { in wpas_dpp_gas_status_handler()
4332 if (auth->waiting_new_key && ok) { in wpas_dpp_gas_status_handler()
4345 if (ok && auth->peer_version >= 2 && in wpas_dpp_gas_status_handler()
4346 auth->conf_resp_status == DPP_STATUS_OK && in wpas_dpp_gas_status_handler()
4347 !auth->waiting_conf_result) { in wpas_dpp_gas_status_handler()
4349 auth->waiting_conf_result = 1; in wpas_dpp_gas_status_handler()
4350 auth->conf_resp = NULL; in wpas_dpp_gas_status_handler()
4364 auth->conf_resp_status); in wpas_dpp_gas_status_handler()
4389 struct dpp_authentication *auth; in wpas_dpp_configurator_sign() local
4393 auth = dpp_alloc_auth(wpa_s->dpp, wpa_s); in wpas_dpp_configurator_sign()
4394 if (!auth) in wpas_dpp_configurator_sign()
4398 wpas_dpp_set_testing_options(wpa_s, auth); in wpas_dpp_configurator_sign()
4399 if (dpp_set_configurator(auth, cmd) == 0 && in wpas_dpp_configurator_sign()
4400 dpp_configurator_own_config(auth, curve, 0) == 0) in wpas_dpp_configurator_sign()
4401 ret = wpas_dpp_handle_config_obj(wpa_s, auth, in wpas_dpp_configurator_sign()
4402 &auth->conf_obj[0]); in wpas_dpp_configurator_sign()
4404 wpas_dpp_post_process_config(wpa_s, auth); in wpas_dpp_configurator_sign()
4406 dpp_auth_deinit(auth); in wpas_dpp_configurator_sign()
4894 struct dpp_authentication *auth, bool tcp) in wpas_dpp_build_conf_resp() argument
4898 resp = dpp_build_conf_resp(auth, auth->e_nonce, auth->curve->nonce_len, in wpas_dpp_build_conf_resp()
4899 auth->e_netrole, true); in wpas_dpp_build_conf_resp()
4904 auth->conf_resp_tcp = resp; in wpas_dpp_build_conf_resp()
4909 if (gas_server_set_resp(wpa_s->gas_server, auth->config_resp_ctx, in wpas_dpp_build_conf_resp()
4916 auth->conf_resp = resp; in wpas_dpp_build_conf_resp()
4925 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_conf_set() local
4933 if (!auth || !auth->waiting_config || in wpas_dpp_conf_set()
4934 (auth->peer_bi && in wpas_dpp_conf_set()
4935 (unsigned int) peer != auth->peer_bi->id)) { in wpas_dpp_conf_set()
4936 auth = dpp_controller_get_auth(wpa_s->dpp, peer); in wpas_dpp_conf_set()
4941 if (!auth || !auth->waiting_config) { in wpas_dpp_conf_set()
4947 if ((!auth->peer_bi || in wpas_dpp_conf_set()
4948 (unsigned int) peer != auth->peer_bi->id) && in wpas_dpp_conf_set()
4949 (!auth->tmp_peer_bi || in wpas_dpp_conf_set()
4950 (unsigned int) peer != auth->tmp_peer_bi->id)) { in wpas_dpp_conf_set()
4960 auth->config_resp_ctx, in wpas_dpp_conf_set()
4965 if (dpp_set_configurator(auth, cmd) < 0) in wpas_dpp_conf_set()
4968 auth->use_config_query = false; in wpas_dpp_conf_set()
4969 auth->waiting_config = false; in wpas_dpp_conf_set()
4970 return wpas_dpp_build_conf_resp(wpa_s, auth, tcp); in wpas_dpp_conf_set()
5405 struct dpp_authentication *auth = wpa_s->dpp_auth; in wpas_dpp_ca_set() local
5414 if (!auth || !auth->waiting_cert || in wpas_dpp_ca_set()
5415 (auth->peer_bi && in wpas_dpp_ca_set()
5416 (unsigned int) peer != auth->peer_bi->id)) { in wpas_dpp_ca_set()
5417 auth = dpp_controller_get_auth(wpa_s->dpp, peer); in wpas_dpp_ca_set()
5422 if (!auth || !auth->waiting_cert) { in wpas_dpp_ca_set()
5429 (!auth->peer_bi || in wpas_dpp_ca_set()
5430 (unsigned int) peer != auth->peer_bi->id) && in wpas_dpp_ca_set()
5431 (!auth->tmp_peer_bi || in wpas_dpp_ca_set()
5432 (unsigned int) peer != auth->tmp_peer_bi->id)) { in wpas_dpp_ca_set()
5448 auth->force_conf_resp_status = atoi(value); in wpas_dpp_ca_set()
5449 return wpas_dpp_build_conf_resp(wpa_s, auth, tcp); in wpas_dpp_ca_set()
5453 os_free(auth->trusted_eap_server_name); in wpas_dpp_ca_set()
5454 auth->trusted_eap_server_name = os_strdup(value); in wpas_dpp_ca_set()
5455 return auth->trusted_eap_server_name ? 0 : -1; in wpas_dpp_ca_set()
5465 wpabuf_free(auth->cacert); in wpas_dpp_ca_set()
5466 auth->cacert = buf; in wpas_dpp_ca_set()
5471 wpabuf_free(auth->certbag); in wpas_dpp_ca_set()
5472 auth->certbag = buf; in wpas_dpp_ca_set()
5473 return wpas_dpp_build_conf_resp(wpa_s, auth, tcp); in wpas_dpp_ca_set()