wpa_supplicant(hidl): Set 'ieee80211w' when PMF required
Global opt 'pmf' determines whether to enable/require PMF by default.
This can be overwrite by the per-network opt 'ieee80211w'.
Now hidl always sets 'ieee80211w' to 'disabled' or 'PMF required',
which makes the global opt 'pmf' not take effect.
Change hidl to set 'ieee80211w' only when PMF required, and in other
cases, PMF is determined by global opt 'pmf'.
Change-Id: Ie5efcb41bbdd4d88ae28d9665d5fc621535dabbe
CRs-Fixed: 2372577
Bug: 123009885
(cherry-picked from 388e8c2b5c9539f24ff2c57e3cbaa9d2280d6608)
diff --git a/wpa_supplicant/hidl/1.2/sta_network.cpp b/wpa_supplicant/hidl/1.2/sta_network.cpp
index cf15909..780c5a1 100644
--- a/wpa_supplicant/hidl/1.2/sta_network.cpp
+++ b/wpa_supplicant/hidl/1.2/sta_network.cpp
@@ -1010,8 +1010,9 @@
SupplicantStatus StaNetwork::setRequirePmfInternal(bool enable)
{
struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
- wpa_ssid->ieee80211w =
- enable ? MGMT_FRAME_PROTECTION_REQUIRED : NO_MGMT_FRAME_PROTECTION;
+ if (enable) {
+ wpa_ssid->ieee80211w = MGMT_FRAME_PROTECTION_REQUIRED;
+ }
resetInternalStateAfterParamsUpdate();
return {SupplicantStatusCode::SUCCESS, ""};
}