]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Extend pmf_in_use() to be aware of affiliated links on non-AP MLD
authorJouni Malinen <j@w1.fi>
Sat, 13 Jan 2024 10:24:00 +0000 (12:24 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 13 Jan 2024 17:09:31 +0000 (19:09 +0200)
The target MAC address needs to be checked against all the AP MLD link
addresses and the MLD MAC address to cover all possible cases. This is
needed to be able to correctly use Protected Dual of Public Action
frames during an ML association.

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

index 134ba39c530211c50b1220fe0b63a7becccb3cbc..1697d4a1f67c9dee65f9ef99ade82554e4784da3 100644 (file)
@@ -8637,9 +8637,16 @@ bool wpas_is_sae_avoided(struct wpa_supplicant *wpa_s,
 int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr)
 {
        if (wpa_s->current_ssid == NULL ||
-           wpa_s->wpa_state < WPA_4WAY_HANDSHAKE ||
-           os_memcmp(addr, wpa_s->bssid, ETH_ALEN) != 0)
+           wpa_s->wpa_state < WPA_4WAY_HANDSHAKE)
                return 0;
+       if (wpa_s->valid_links) {
+               if (os_memcmp(addr, wpa_s->ap_mld_addr, ETH_ALEN) != 0 &&
+                   !wpas_ap_link_address(wpa_s, addr))
+                       return 0;
+       } else {
+               if (os_memcmp(addr, wpa_s->bssid, ETH_ALEN) != 0)
+                       return 0;
+       }
        return wpa_sm_pmf_enabled(wpa_s->wpa);
 }
 
@@ -9311,7 +9318,7 @@ wpa_drv_get_scan_results2(struct wpa_supplicant *wpa_s)
 }
 
 
-static bool wpas_ap_link_address(struct wpa_supplicant *wpa_s, const u8 *addr)
+bool wpas_ap_link_address(struct wpa_supplicant *wpa_s, const u8 *addr)
 {
        int i;
 
index 44e4416b1440fb76dcd7a687b174c17550dff24e..3d4d21f194c84100c4426d5ad9fa57dcef987711 100644 (file)
@@ -1989,5 +1989,6 @@ void wpas_pasn_auth_work_done(struct wpa_supplicant *wpa_s, int status);
 bool wpas_is_6ghz_supported(struct wpa_supplicant *wpa_s, bool only_enabled);
 
 bool wpa_is_non_eht_scs_traffic_desc_supported(struct wpa_bss *bss);
+bool wpas_ap_link_address(struct wpa_supplicant *wpa_s, const u8 *addr);
 
 #endif /* WPA_SUPPLICANT_I_H */