]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Do not indicate incorrect PBC overlap based on partner link
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 20 Jan 2023 17:08:07 +0000 (19:08 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 20 Jan 2023 17:08:07 +0000 (19:08 +0200)
The check for PBC overlap on a partner link should not be done unless
the current interface is actually in active PBC mode. Furthermore, the
wpa_s->wps_overlap variable needs to be cleared in additional places to
avoid leaving it set indefinitely.

This was found with the following test case sequence:
dbus_wps_pbc_overlap dbus_p2p_two_groups

Fixes: b43e19f3f369 ("WPS: Cross band overlap detection with multiple interfaces")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/events.c
wpa_supplicant/wps_supplicant.c

index 64b2bcd1daf1382cef3f352a0f3aef443090f24b..6f0ffa5b0e77917df07897e907494723e81b73e1 100644 (file)
@@ -1821,7 +1821,8 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
                           struct wpa_bss *selected,
                           struct wpa_ssid *ssid)
 {
-       if (wpas_wps_partner_link_overlap_detect(wpa_s) ||
+       if ((eap_is_wps_pbc_enrollee(&ssid->eap) &&
+            wpas_wps_partner_link_overlap_detect(wpa_s)) ||
            wpas_wps_scan_pbc_overlap(wpa_s, selected, ssid)) {
                wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_OVERLAP
                        "PBC session overlap");
index fdc1ec72ffd9b889a050fa95682d176b4e976137..220a5f8b50238b221b880fe52833a137229b9d99 100644 (file)
@@ -1014,6 +1014,7 @@ static void wpas_wps_timeout(void *eloop_ctx, void *timeout_ctx)
         */
        wpas_notify_wps_event_fail(wpa_s, &data.fail);
        wpa_s->supp_pbc_active = false;
+       wpa_s->wps_overlap = false;
        wpas_clear_wps(wpa_s);
 }
 
@@ -1386,6 +1387,7 @@ int wpas_wps_cancel(struct wpa_supplicant *wpa_s)
        }
 
        wpa_s->supp_pbc_active = false;
+       wpa_s->wps_overlap = false;
        wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_CANCEL);
        wpa_s->after_wps = 0;