]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OWE: Optimize transition mode AP scan with owe_only=1 STA configuration
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 23 Nov 2023 18:41:35 +0000 (20:41 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 23 Nov 2023 18:41:35 +0000 (20:41 +0200)
Extend the optimization from commit 9c97126576b7 ("OWE: Optimize
transition mode scan to use known channels") to cover cases where the
STA is configued with OWE transition mode disabled, but the AP uses OWE
transition mode.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/events.c

index 372d0535e4253a58002be2c35c33c9e072293aaa..e9d6d0244d7e4d6f66ba91d671fea2aaf7653cdc 100644 (file)
@@ -758,15 +758,33 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
                return 0;
        }
 
+       wpa_ie = wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE);
+
        if (wpas_get_ssid_pmf(wpa_s, ssid) == MGMT_FRAME_PROTECTION_REQUIRED &&
            (!(ssid->key_mgmt & WPA_KEY_MGMT_OWE) || ssid->owe_only)) {
+#ifdef CONFIG_OWE
+               if ((ssid->key_mgmt & WPA_KEY_MGMT_OWE) && ssid->owe_only &&
+                   !wpa_ie && !rsn_ie &&
+                   wpa_s->owe_transition_select &&
+                   wpa_bss_get_vendor_ie(bss, OWE_IE_VENDOR_TYPE) &&
+                   ssid->owe_transition_bss_select_count + 1 <=
+                   MAX_OWE_TRANSITION_BSS_SELECT_COUNT) {
+                       ssid->owe_transition_bss_select_count++;
+                       if (debug_print)
+                               wpa_dbg(wpa_s, MSG_DEBUG,
+                                       "   skip OWE open BSS (selection count %d does not exceed %d)",
+                                       ssid->owe_transition_bss_select_count,
+                                       MAX_OWE_TRANSITION_BSS_SELECT_COUNT);
+                       wpa_s->owe_transition_search = 1;
+                       return 0;
+               }
+#endif /* CONFIG_OWE */
                if (debug_print)
                        wpa_dbg(wpa_s, MSG_DEBUG,
                                "   skip - MFP Required but network not MFP Capable");
                return 0;
        }
 
-       wpa_ie = wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE);
        while ((ssid->proto & WPA_PROTO_WPA) && wpa_ie) {
                proto_match++;