From: Andrzej Ostruszka Date: Tue, 7 Nov 2023 12:30:57 +0000 (+0100) Subject: OWE: Do not update the BSS entry with zero length SSID for transition X-Git-Tag: hostap_2_11~812 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00b312587158d50956c8f747c0e32d0eebe9fbb8;p=thirdparty%2Fhostap.git OWE: Do not update the BSS entry with zero length SSID for transition Overwriting of SSID for the hidden OWE BSS entry has some side effects: - first the entry is notified over DBus with empty SSID and the update of SSID is never signaled (it is not even possible at the moment to notify the SSID change - see wpas_dbus_bss_signal_prop_changed()), - during (and after) association there will be multiple entries referring to the same BSSID/SSID pair. Stop overwriting the SSID in an existing BSS entry based on OWE transition mode information. Instead, depend on a new BSS entry getting added for the hidden OWE BSS based on active scans for the SSID learned from the open BSS. This would not have been sufficient for the initial OWE design, but with the optimized scanning behavior from commit c04562e67edd ("OWE: Improve discovery of OWE transition mode AP"), this can now depend on the exact same mechanism as other uses of hidden SSIDs. This helps in keeping the D-Bus interface in sync with the BSS parameters. Signed-off-by: Andrzej Ostruszka --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index d41676747..aecce25a1 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1097,7 +1097,6 @@ static void owe_trans_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, #ifdef CONFIG_OWE const u8 *owe, *pos, *end, *bssid; u8 ssid_len; - struct wpa_bss *open_bss; owe = wpa_bss_get_vendor_ie(bss, OWE_IE_VENDOR_TYPE); if (!owe || !wpa_bss_get_ie(bss, WLAN_EID_RSN)) @@ -1138,48 +1137,6 @@ static void owe_trans_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, } } } - - if (bss->ssid_len > 0) - return; - - open_bss = wpa_bss_get_bssid_latest(wpa_s, bssid); - if (!open_bss) - return; - if (ssid_len != open_bss->ssid_len || - os_memcmp(pos, open_bss->ssid, ssid_len) != 0) { - wpa_dbg(wpa_s, MSG_DEBUG, - "OWE: transition mode SSID mismatch: %s", - wpa_ssid_txt(open_bss->ssid, open_bss->ssid_len)); - return; - } - - owe = wpa_bss_get_vendor_ie(open_bss, OWE_IE_VENDOR_TYPE); - if (!owe || wpa_bss_get_ie(open_bss, WLAN_EID_RSN)) { - wpa_dbg(wpa_s, MSG_DEBUG, - "OWE: transition mode open BSS unexpected info"); - return; - } - - pos = owe + 6; - end = owe + 2 + owe[1]; - - if (end - pos < ETH_ALEN + 1) - return; - if (os_memcmp(pos, bss->bssid, ETH_ALEN) != 0) { - wpa_dbg(wpa_s, MSG_DEBUG, - "OWE: transition mode BSSID mismatch: " MACSTR, - MAC2STR(pos)); - return; - } - pos += ETH_ALEN; - ssid_len = *pos++; - if (end - pos < ssid_len || ssid_len > SSID_MAX_LEN) - return; - wpa_dbg(wpa_s, MSG_DEBUG, "OWE: learned transition mode OWE SSID: %s", - 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 */ }