DPP: Stop listen mode for chirp-initiated Authentication exchange

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>
This commit is contained in:
Jouni Malinen 2022-11-05 17:25:15 +02:00
parent 2e73394426
commit 6527a76566

View file

@ -2272,6 +2272,7 @@ wpas_dpp_rx_presence_announcement(struct wpa_supplicant *wpa_s, const u8 *src,
u16 r_bootstrap_len; u16 r_bootstrap_len;
struct dpp_bootstrap_info *peer_bi; struct dpp_bootstrap_info *peer_bi;
struct dpp_authentication *auth; struct dpp_authentication *auth;
unsigned int wait_time, max_wait_time;
if (!wpa_s->dpp) if (!wpa_s->dpp)
return; return;
@ -2303,6 +2304,9 @@ wpas_dpp_rx_presence_announcement(struct wpa_supplicant *wpa_s, const u8 *src,
return; 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, auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, NULL,
DPP_CAPAB_CONFIGURATOR, freq, NULL, 0); DPP_CAPAB_CONFIGURATOR, freq, NULL, 0);
if (!auth) 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. */ * MAC address information from the bootstrapping information. */
os_memcpy(auth->peer_mac_addr, src, ETH_ALEN); 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; wpa_s->dpp_auth = auth;
if (wpas_dpp_auth_init_next(wpa_s) < 0) { if (wpas_dpp_auth_init_next(wpa_s) < 0) {
dpp_auth_deinit(wpa_s->dpp_auth); dpp_auth_deinit(wpa_s->dpp_auth);