Lines Matching full:auth

35 					    struct dpp_authentication *auth);
41 struct dpp_authentication *auth,
44 struct dpp_authentication *auth);
59 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_qr_code() local
65 if (auth && auth->response_pending && in hostapd_dpp_qr_code()
66 dpp_notify_new_qr_code(auth, bi) == 1) { in hostapd_dpp_qr_code()
71 MAC2STR(auth->peer_mac_addr), auth->curr_freq, in hostapd_dpp_qr_code()
73 hostapd_drv_send_action(hapd, auth->curr_freq, 0, in hostapd_dpp_qr_code()
74 auth->peer_mac_addr, in hostapd_dpp_qr_code()
174 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_auth_resp_retry_timeout() local
176 if (!auth || !auth->resp_msg) in hostapd_dpp_auth_resp_retry_timeout()
183 MAC2STR(auth->peer_mac_addr), auth->curr_freq, in hostapd_dpp_auth_resp_retry_timeout()
185 hostapd_drv_send_action(hapd, auth->curr_freq, 500, auth->peer_mac_addr, in hostapd_dpp_auth_resp_retry_timeout()
186 wpabuf_head(auth->resp_msg), in hostapd_dpp_auth_resp_retry_timeout()
187 wpabuf_len(auth->resp_msg)); in hostapd_dpp_auth_resp_retry_timeout()
193 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_auth_resp_retry() local
196 if (!auth || !auth->resp_msg) in hostapd_dpp_auth_resp_retry()
203 auth->auth_resp_tries++; in hostapd_dpp_auth_resp_retry()
204 if (auth->auth_resp_tries >= max_tries) { in hostapd_dpp_auth_resp_retry()
308 struct dpp_authentication *auth; in hostapd_dpp_pkex_done() local
350 auth = dpp_auth_init(hapd->iface->interfaces->dpp, hapd->msg_ctx, in hostapd_dpp_pkex_done()
354 if (!auth) in hostapd_dpp_pkex_done()
357 hostapd_dpp_set_testing_options(hapd, auth); in hostapd_dpp_pkex_done()
358 if (dpp_set_configurator(auth, cmd) < 0) { in hostapd_dpp_pkex_done()
359 dpp_auth_deinit(auth); in hostapd_dpp_pkex_done()
363 return dpp_tcp_auth(hapd->iface->interfaces->dpp, conn, auth, in hostapd_dpp_pkex_done()
494 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_tx_status() local
513 if (auth->connect_on_tx_status) { in hostapd_dpp_tx_status()
555 if (auth->waiting_auth_resp) { in hostapd_dpp_tx_status()
562 if (auth->waiting_auth_conf) { in hostapd_dpp_tx_status()
568 if (auth->waiting_auth_conf && in hostapd_dpp_tx_status()
569 auth->auth_resp_status == DPP_STATUS_OK) { in hostapd_dpp_tx_status()
570 /* Make sure we do not get stuck waiting for Auth Confirm in hostapd_dpp_tx_status()
571 * indefinitely after successfully transmitted Auth Response to in hostapd_dpp_tx_status()
579 if (!is_broadcast_ether_addr(dst) && auth->waiting_auth_resp && ok) { in hostapd_dpp_tx_status()
582 auth->auth_req_ack = 1; in hostapd_dpp_tx_status()
610 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_reply_wait_timeout() local
615 if (!auth || !auth->waiting_auth_resp) in hostapd_dpp_reply_wait_timeout()
627 if (auth->auth_req_ack && diff_ms >= wait_time) { in hostapd_dpp_reply_wait_timeout()
635 dpp_auth_deinit(auth); in hostapd_dpp_reply_wait_timeout()
659 freq = auth->curr_freq; in hostapd_dpp_reply_wait_timeout()
660 if (auth->neg_freq > 0) in hostapd_dpp_reply_wait_timeout()
661 freq = auth->neg_freq; in hostapd_dpp_reply_wait_timeout()
683 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_auth_conf_wait_timeout() local
685 if (!auth || !auth->waiting_auth_conf) in hostapd_dpp_auth_conf_wait_timeout()
689 "DPP: Terminate authentication exchange due to Auth Confirm timeout"); in hostapd_dpp_auth_conf_wait_timeout()
691 "No Auth Confirm received"); in hostapd_dpp_auth_conf_wait_timeout()
693 dpp_auth_deinit(auth); in hostapd_dpp_auth_conf_wait_timeout()
699 struct dpp_authentication *auth) in hostapd_dpp_set_testing_options() argument
703 auth->config_obj_override = in hostapd_dpp_set_testing_options()
706 auth->discovery_override = in hostapd_dpp_set_testing_options()
709 auth->groups_override = os_strdup(hapd->dpp_groups_override); in hostapd_dpp_set_testing_options()
710 auth->ignore_netaccesskey_mismatch = in hostapd_dpp_set_testing_options()
729 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_auth_init_next() local
734 if (!auth) in hostapd_dpp_auth_init_next()
737 if (auth->freq_idx == 0) in hostapd_dpp_auth_init_next()
740 if (auth->freq_idx >= auth->num_freq) { in hostapd_dpp_auth_init_next()
741 auth->num_freq_iters++; in hostapd_dpp_auth_init_next()
746 if (auth->num_freq_iters >= max_tries || auth->auth_req_ack) { in hostapd_dpp_auth_init_next()
758 auth->freq_idx = 0; in hostapd_dpp_auth_init_next()
779 freq = auth->freq[auth->freq_idx++]; in hostapd_dpp_auth_init_next()
780 auth->curr_freq = freq; in hostapd_dpp_auth_init_next()
782 if (!is_zero_ether_addr(auth->peer_mac_addr)) in hostapd_dpp_auth_init_next()
783 dst = auth->peer_mac_addr; in hostapd_dpp_auth_init_next()
784 else if (is_zero_ether_addr(auth->peer_bi->mac_addr)) in hostapd_dpp_auth_init_next()
787 dst = auth->peer_bi->mac_addr; in hostapd_dpp_auth_init_next()
799 if (auth->neg_freq > 0 && freq != auth->neg_freq) { in hostapd_dpp_auth_init_next()
802 freq, auth->neg_freq); in hostapd_dpp_auth_init_next()
807 auth->auth_req_ack = 0; in hostapd_dpp_auth_init_next()
818 struct dpp_authentication *auth) in hostapd_dpp_process_conf_obj() argument
823 for (i = 0; i < auth->num_conf_obj; i++) in hostapd_dpp_process_conf_obj()
824 hostapd_dpp_handle_config_obj(hapd, auth, in hostapd_dpp_process_conf_obj()
825 &auth->conf_obj[i]); in hostapd_dpp_process_conf_obj()
836 struct dpp_authentication *auth; in hostapd_dpp_auth_init() local
939 auth = dpp_auth_init(hapd->iface->interfaces->dpp, hapd->msg_ctx, in hostapd_dpp_auth_init()
943 if (!auth) in hostapd_dpp_auth_init()
945 hostapd_dpp_set_testing_options(hapd, auth); in hostapd_dpp_auth_init()
946 if (dpp_set_configurator(auth, cmd) < 0) { in hostapd_dpp_auth_init()
947 dpp_auth_deinit(auth); in hostapd_dpp_auth_init()
951 auth->neg_freq = neg_freq; in hostapd_dpp_auth_init()
954 os_memcpy(auth->peer_mac_addr, peer_bi->mac_addr, ETH_ALEN); in hostapd_dpp_auth_init()
958 return dpp_tcp_init(hapd->iface->interfaces->dpp, auth, in hostapd_dpp_auth_init()
967 hapd->dpp_auth = auth; in hostapd_dpp_auth_init()
1140 struct dpp_authentication *auth, in hostapd_dpp_handle_config_obj() argument
1188 if (auth->net_access_key) { in hostapd_dpp_handle_config_obj()
1192 hexlen = 2 * wpabuf_len(auth->net_access_key) + 1; in hostapd_dpp_handle_config_obj()
1196 wpabuf_head(auth->net_access_key), in hostapd_dpp_handle_config_obj()
1197 wpabuf_len(auth->net_access_key)); in hostapd_dpp_handle_config_obj()
1198 if (auth->net_access_key_expiry) in hostapd_dpp_handle_config_obj()
1202 auth->net_access_key_expiry); in hostapd_dpp_handle_config_obj()
1243 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_build_new_key() local
1245 if (!auth || !auth->waiting_new_key) in hostapd_dpp_build_new_key()
1261 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_gas_resp_cb() local
1265 if (!auth || !auth->auth_success) { in hostapd_dpp_gas_resp_cb()
1294 res = dpp_conf_resp_rx(auth, resp); in hostapd_dpp_gas_resp_cb()
1308 hostapd_dpp_handle_config_obj(hapd, auth, &auth->conf_obj[0]); in hostapd_dpp_gas_resp_cb()
1309 if (hostapd_dpp_handle_key_pkg(hapd, auth->conf_key_pkg) < 0) in hostapd_dpp_gas_resp_cb()
1323 if (auth->peer_version >= 2 && in hostapd_dpp_gas_resp_cb()
1324 auth->conf_resp_status == DPP_STATUS_OK) { in hostapd_dpp_gas_resp_cb()
1328 msg = dpp_build_conf_result(auth, status); in hostapd_dpp_gas_resp_cb()
1334 MAC2STR(addr), auth->curr_freq, in hostapd_dpp_gas_resp_cb()
1336 hostapd_drv_send_action(hapd, auth->curr_freq, 0, in hostapd_dpp_gas_resp_cb()
1342 auth->connect_on_tx_status = 1; in hostapd_dpp_gas_resp_cb()
1354 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_start_gas_client() local
1358 buf = dpp_build_conf_req_helper(auth, hapd->conf->dpp_name, in hostapd_dpp_start_gas_client()
1370 MAC2STR(auth->peer_mac_addr), auth->curr_freq); in hostapd_dpp_start_gas_client()
1372 res = gas_query_ap_req(hapd->gas, auth->peer_mac_addr, auth->curr_freq, in hostapd_dpp_start_gas_client()
1410 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_rx_auth_resp() local
1416 if (!auth) { in hostapd_dpp_rx_auth_resp()
1422 if (!is_zero_ether_addr(auth->peer_mac_addr) && in hostapd_dpp_rx_auth_resp()
1423 !ether_addr_equal(src, auth->peer_mac_addr)) { in hostapd_dpp_rx_auth_resp()
1425 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in hostapd_dpp_rx_auth_resp()
1431 if (auth->curr_freq != freq && auth->neg_freq == freq) { in hostapd_dpp_rx_auth_resp()
1434 auth->curr_freq = freq; in hostapd_dpp_rx_auth_resp()
1438 msg = dpp_auth_resp_rx(auth, hdr, buf, len); in hostapd_dpp_rx_auth_resp()
1440 if (auth->auth_resp_status == DPP_STATUS_RESPONSE_PENDING) { in hostapd_dpp_rx_auth_resp()
1447 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in hostapd_dpp_rx_auth_resp()
1450 " freq=%u type=%d", MAC2STR(src), auth->curr_freq, in hostapd_dpp_rx_auth_resp()
1452 hostapd_drv_send_action(hapd, auth->curr_freq, 0, src, in hostapd_dpp_rx_auth_resp()
1462 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_rx_auth_conf() local
1467 if (!auth) { in hostapd_dpp_rx_auth_conf()
1473 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in hostapd_dpp_rx_auth_conf()
1475 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in hostapd_dpp_rx_auth_conf()
1479 if (dpp_auth_conf_rx(auth, hdr, buf, len) < 0) { in hostapd_dpp_rx_auth_conf()
1494 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_config_result_wait_timeout() local
1496 if (!auth || !auth->waiting_conf_result) in hostapd_dpp_config_result_wait_timeout()
1502 dpp_auth_deinit(auth); in hostapd_dpp_config_result_wait_timeout()
1511 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_conn_status_result_wait_timeout() local
1513 if (!auth || !auth->waiting_conf_result) in hostapd_dpp_conn_status_result_wait_timeout()
1520 dpp_auth_deinit(auth); in hostapd_dpp_conn_status_result_wait_timeout()
1567 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_rx_conf_result() local
1576 if (!auth || !auth->waiting_conf_result) { in hostapd_dpp_rx_conf_result()
1582 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in hostapd_dpp_rx_conf_result()
1584 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in hostapd_dpp_rx_conf_result()
1588 status = dpp_conf_result_rx(auth, hdr, buf, len); in hostapd_dpp_rx_conf_result()
1590 if (status == DPP_STATUS_OK && auth->send_conn_status) { in hostapd_dpp_rx_conf_result()
1593 auth->conf_resp_status); in hostapd_dpp_rx_conf_result()
1597 auth->waiting_conn_status_result = 1; in hostapd_dpp_rx_conf_result()
1610 "conf_status=%d", auth->conf_resp_status); in hostapd_dpp_rx_conf_result()
1613 dpp_auth_deinit(auth); in hostapd_dpp_rx_conf_result()
1638 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_rx_conn_status_result() local
1646 if (!auth || !auth->waiting_conn_status_result) { in hostapd_dpp_rx_conn_status_result()
1652 status = dpp_conn_status_result_rx(auth, hdr, buf, len, in hostapd_dpp_rx_conn_status_result()
1661 dpp_auth_deinit(auth); in hostapd_dpp_rx_conn_status_result()
1676 struct dpp_authentication *auth; in hostapd_dpp_rx_presence_announcement() local
1713 auth = dpp_auth_init(hapd->iface->interfaces->dpp, hapd->msg_ctx, in hostapd_dpp_rx_presence_announcement()
1716 if (!auth) in hostapd_dpp_rx_presence_announcement()
1718 hostapd_dpp_set_testing_options(hapd, auth); in hostapd_dpp_rx_presence_announcement()
1719 if (dpp_set_configurator(auth, in hostapd_dpp_rx_presence_announcement()
1721 dpp_auth_deinit(auth); in hostapd_dpp_rx_presence_announcement()
1725 auth->neg_freq = freq; in hostapd_dpp_rx_presence_announcement()
1729 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in hostapd_dpp_rx_presence_announcement()
1731 hapd->dpp_auth = auth; in hostapd_dpp_rx_presence_announcement()
1743 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_reconfig_reply_wait_timeout() local
1745 if (!auth) in hostapd_dpp_reconfig_reply_wait_timeout()
1750 dpp_auth_deinit(auth); in hostapd_dpp_reconfig_reply_wait_timeout()
1763 struct dpp_authentication *auth; in hostapd_dpp_rx_reconfig_announcement() local
1812 auth = dpp_reconfig_init(hapd->iface->interfaces->dpp, hapd->msg_ctx, in hostapd_dpp_rx_reconfig_announcement()
1815 if (!auth) in hostapd_dpp_rx_reconfig_announcement()
1817 hostapd_dpp_set_testing_options(hapd, auth); in hostapd_dpp_rx_reconfig_announcement()
1818 if (dpp_set_configurator(auth, hapd->dpp_configurator_params) < 0) { in hostapd_dpp_rx_reconfig_announcement()
1819 dpp_auth_deinit(auth); in hostapd_dpp_rx_reconfig_announcement()
1823 os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); in hostapd_dpp_rx_reconfig_announcement()
1824 hapd->dpp_auth = auth; in hostapd_dpp_rx_reconfig_announcement()
1843 wpabuf_head(auth->reconfig_req_msg), in hostapd_dpp_rx_reconfig_announcement()
1844 wpabuf_len(auth->reconfig_req_msg)) < 0) { in hostapd_dpp_rx_reconfig_announcement()
1856 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_rx_reconfig_auth_resp() local
1862 if (!auth || !auth->reconfig || !auth->configurator) { in hostapd_dpp_rx_reconfig_auth_resp()
1868 if (!ether_addr_equal(src, auth->peer_mac_addr)) { in hostapd_dpp_rx_reconfig_auth_resp()
1870 MACSTR ") - drop", MAC2STR(auth->peer_mac_addr)); in hostapd_dpp_rx_reconfig_auth_resp()
1874 conf = dpp_reconfig_auth_resp_rx(auth, hdr, buf, len); in hostapd_dpp_rx_reconfig_auth_resp()
3078 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_gas_req_handler() local
3082 if (!auth || (!auth->auth_success && !auth->reconfig_success) || in hostapd_dpp_gas_req_handler()
3083 !ether_addr_equal(sa, auth->peer_mac_addr)) { in hostapd_dpp_gas_req_handler()
3095 if (hapd->dpp_auth_ok_on_ack && auth->configurator) { in hostapd_dpp_gas_req_handler()
3097 …"DPP: Have not received ACK for Auth Confirm yet - assume it was received based on this GAS reques… in hostapd_dpp_gas_req_handler()
3118 resp = dpp_conf_req_rx(auth, query, query_len); in hostapd_dpp_gas_req_handler()
3127 struct dpp_authentication *auth = hapd->dpp_auth; in hostapd_dpp_gas_status_handler() local
3132 if (!auth) in hostapd_dpp_gas_status_handler()
3136 if (auth->waiting_new_key && ok) { in hostapd_dpp_gas_status_handler()
3150 if (ok && auth->peer_version >= 2 && in hostapd_dpp_gas_status_handler()
3151 auth->conf_resp_status == DPP_STATUS_OK) { in hostapd_dpp_gas_status_handler()
3153 auth->waiting_conf_result = 1; in hostapd_dpp_gas_status_handler()
3166 "conf_status=%d", auth->conf_resp_status); in hostapd_dpp_gas_status_handler()
3190 struct dpp_authentication *auth; in hostapd_dpp_configurator_sign() local
3194 auth = dpp_alloc_auth(hapd->iface->interfaces->dpp, hapd->msg_ctx); in hostapd_dpp_configurator_sign()
3195 if (!auth) in hostapd_dpp_configurator_sign()
3199 hostapd_dpp_set_testing_options(hapd, auth); in hostapd_dpp_configurator_sign()
3200 if (dpp_set_configurator(auth, cmd) == 0 && in hostapd_dpp_configurator_sign()
3201 dpp_configurator_own_config(auth, curve, 1) == 0) { in hostapd_dpp_configurator_sign()
3202 hostapd_dpp_handle_config_obj(hapd, auth, &auth->conf_obj[0]); in hostapd_dpp_configurator_sign()
3206 dpp_auth_deinit(auth); in hostapd_dpp_configurator_sign()