]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OWE: Avoid incorrect profile update in transition mode
authorJouni Malinen <j@w1.fi>
Sat, 7 Mar 2020 16:03:32 +0000 (18:03 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 7 Mar 2020 16:03:32 +0000 (18:03 +0200)
The "unexpected" change of SSID between the current network profile
(which uses the SSID from the open BSS in OWE transition mode) and the
association with the OWE BSS (which uses a random, hidden SSID) resulted
in wpa_supplicant incorrectly determining that this was a
driver-initiated BSS selection ("Driver-initiated BSS selection changed
the SSID to <the random SSID from OWE BSS>" in debug log).

This ended up with updating security parameters based on the network
profile inwpa_supplicant_set_suites() instead of using the already
discovered information from scan results. In particular, this cleared
the RSN supplicant state machine information of AP RSNE and resulted in
having to fetch the scan results for the current BSS when processing
EAPOL-Key msg 3/4.

Fix this by recognizing the special case for OWE transition mode where
the SSID for the associated AP does not actually match the SSID in the
network profile.

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

index 3ce8cd3f429aa8027d253d5957eab6e14a9d585b..0716761749f689398312248ccc884af1e23baaa9 100644 (file)
@@ -18,6 +18,7 @@ struct wpa_scan_res;
 #define WPA_BSS_AUTHENTICATED          BIT(4)
 #define WPA_BSS_ASSOCIATED             BIT(5)
 #define WPA_BSS_ANQP_FETCH_TRIED       BIT(6)
+#define WPA_BSS_OWE_TRANSITION         BIT(7)
 
 struct wpa_bss_anqp_elem {
        struct dl_list list;
index 37ae306bbb9e45548f1669c26fcb7458195e8f18..1149aa90bacdc927ca398edc0a38c5b706c04450 100644 (file)
@@ -188,6 +188,16 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
                              drv_ssid_len) == 0)
                        return 0; /* current profile still in use */
 
+#ifdef CONFIG_OWE
+               if ((wpa_s->current_ssid->key_mgmt & WPA_KEY_MGMT_OWE) &&
+                   wpa_s->current_bss &&
+                   (wpa_s->current_bss->flags & WPA_BSS_OWE_TRANSITION) &&
+                   drv_ssid_len == wpa_s->current_bss->ssid_len &&
+                   os_memcmp(drv_ssid, wpa_s->current_bss->ssid,
+                             drv_ssid_len) == 0)
+                       return 0; /* current profile still in use */
+#endif /* CONFIG_OWE */
+
                wpa_msg(wpa_s, MSG_DEBUG,
                        "Driver-initiated BSS selection changed the SSID to %s",
                        wpa_ssid_txt(drv_ssid, drv_ssid_len));
@@ -1025,6 +1035,7 @@ static void owe_trans_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
                wpa_ssid_txt(pos, ssid_len));
        os_memcpy(bss->ssid, pos, ssid_len);
        bss->ssid_len = ssid_len;
+       bss->flags |= WPA_BSS_OWE_TRANSITION;
 #endif /* CONFIG_OWE */
 }