]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Enable PMF automatically if OCV is enabled
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 24 Nov 2022 15:16:26 +0000 (17:16 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 24 Nov 2022 15:16:26 +0000 (17:16 +0200)
OCV cannot be used without PMF and such a configuration were to be used
with wpa_supplicant, the AP would reject the association. hostapd is
already enabling PMF automatically whenever OCV is being enabled, so do
the same with wpa_supplicant.

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

index ab2e70b5d5d3322ecada543a9355bd4218bfc709..ce3583fdeac0e2a04921b99ccb59b080ee9965a2 100644 (file)
@@ -8226,6 +8226,13 @@ int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
                        return NO_MGMT_FRAME_PROTECTION;
                }
 
+#ifdef CONFIG_OCV
+               /* Enable PMF if OCV is being enabled */
+               if (wpa_s->conf->pmf == NO_MGMT_FRAME_PROTECTION &&
+                   ssid && ssid->ocv)
+                       return MGMT_FRAME_PROTECTION_OPTIONAL;
+#endif /* CONFIG_OCV */
+
                return wpa_s->conf->pmf;
        }