]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Stop listen mode for chirp-initiated Authentication exchange
authorJouni Malinen <j@w1.fi>
Sat, 5 Nov 2022 15:25:15 +0000 (17:25 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 5 Nov 2022 15:25:15 +0000 (17:25 +0200)
Stop listen mode if there is not sufficient time remaining to complete
the Authentication exchange within the current remain-on-channel
operation. This speeds up the operation and avoids some timeouts that
could prevent the provisioning step from completing. This addresses an
issue that was found in the following test case sequence:
dpp_controller_relay_discover dpp_chirp_ap_5g

Similar mechanism was already used for Reconfig Announcement frames, so
reuse that for this case with Presence Announcement frames.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/dpp_supplicant.c

index d01d6b7a7202bbf94a1e3b005e6883afa91dc162..10b1301a858388070a9fde3589d403617de1a767 100644 (file)
@@ -2272,6 +2272,7 @@ wpas_dpp_rx_presence_announcement(struct wpa_supplicant *wpa_s, const u8 *src,
        u16 r_bootstrap_len;
        struct dpp_bootstrap_info *peer_bi;
        struct dpp_authentication *auth;
+       unsigned int wait_time, max_wait_time;
 
        if (!wpa_s->dpp)
                return;
@@ -2303,6 +2304,9 @@ wpas_dpp_rx_presence_announcement(struct wpa_supplicant *wpa_s, const u8 *src,
                return;
        }
 
+       wpa_printf(MSG_DEBUG, "DPP: Start Authentication exchange with " MACSTR
+                  " based on the received Presence Announcement",
+                  MAC2STR(src));
        auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, NULL,
                             DPP_CAPAB_CONFIGURATOR, freq, NULL, 0);
        if (!auth)
@@ -2319,6 +2323,13 @@ wpas_dpp_rx_presence_announcement(struct wpa_supplicant *wpa_s, const u8 *src,
         * MAC address information from the bootstrapping information. */
        os_memcpy(auth->peer_mac_addr, src, ETH_ALEN);
 
+       wait_time = wpa_s->max_remain_on_chan;
+       max_wait_time = wpa_s->dpp_resp_wait_time ?
+               wpa_s->dpp_resp_wait_time : 2000;
+       if (wait_time > max_wait_time)
+               wait_time = max_wait_time;
+       wpas_dpp_stop_listen_for_tx(wpa_s, freq, wait_time);
+
        wpa_s->dpp_auth = auth;
        if (wpas_dpp_auth_init_next(wpa_s) < 0) {
                dpp_auth_deinit(wpa_s->dpp_auth);