From ca4fa867d3eeb4f58f1ebb9de94e4584a0fd9747 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 24 Nov 2022 17:16:26 +0200 Subject: [PATCH] Enable PMF automatically if OCV is enabled 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 --- wpa_supplicant/wpa_supplicant.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index ab2e70b5d..ce3583fde 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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; }