]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Force MFPR=1 to be used on the 6 GHz band
authorJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 18:32:23 +0000 (20:32 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 19:07:48 +0000 (21:07 +0200)
IEEE Std 802.11ax-2021, 12.12.2 requires this, so force MFPR=1 when
associating on the 6 GHz band so that ieee80211w=1 (i.e., MFPC=1 MFPR=0)
configuration can be used to get MFPC=1 behavior on other bands and
MFPR=1 on the 6 GHz band.

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

index c17b67aac4de84ae9c37ba690ec69a35f6212923..5abed88c074cdf4e74e6beb291e5464a19761c95 100644 (file)
@@ -1899,7 +1899,8 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
        wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_GROUP, wpa_s->group_cipher);
 
        if (!(ie.capabilities & WPA_CAPABILITY_MFPC) &&
-           wpas_get_ssid_pmf(wpa_s, ssid) == MGMT_FRAME_PROTECTION_REQUIRED) {
+           (wpas_get_ssid_pmf(wpa_s, ssid) == MGMT_FRAME_PROTECTION_REQUIRED ||
+            (bss && is_6ghz_freq(bss->freq)))) {
                wpa_msg(wpa_s, MSG_INFO,
                        "RSN: Management frame protection required but the selected AP does not enable it");
                return -1;
@@ -1932,6 +1933,12 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
                          (!ssid->sae_password && ssid->passphrase &&
                           sae_pk_valid_password(ssid->passphrase))));
 #endif /* CONFIG_SAE_PK */
+       if (bss && is_6ghz_freq(bss->freq) &&
+           wpas_get_ssid_pmf(wpa_s, ssid) != MGMT_FRAME_PROTECTION_REQUIRED) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "RSN: Force MFPR=1 on 6 GHz");
+               wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_MFP,
+                                MGMT_FRAME_PROTECTION_REQUIRED);
+       }
 #ifdef CONFIG_TESTING_OPTIONS
        wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_FT_RSNXE_USED,
                         wpa_s->ft_rsnxe_used);