Home | History | Annotate | Download | only in wpa_supplicant

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