[wpa_supplicant] Set the OWE only flag when KeyMgmt set to OWE
When manually configuring an OWE network as hidden, the phone
connected to an Open network with the same SSID.
Setting the OWE only flag when the key managemenet is set to OWE.
Bug: 169472668
Test: Manually configure GoogleGuest as Enhanced Open and hidden,
verify that the phone does not connect.
Change-Id: Ic793e09ed69156c3e28f859317375693c521a641
diff --git a/wpa_supplicant/hidl/1.4/sta_network.cpp b/wpa_supplicant/hidl/1.4/sta_network.cpp
index 6d53282..3e773de 100644
--- a/wpa_supplicant/hidl/1.4/sta_network.cpp
+++ b/wpa_supplicant/hidl/1.4/sta_network.cpp
@@ -2273,6 +2273,11 @@
return {SupplicantStatusCode::FAILURE_ARGS_INVALID, ""};
}
setFastTransitionKeyMgmt(key_mgmt_mask);
+
+ if (key_mgmt_mask & WPA_KEY_MGMT_OWE) {
+ // Do not allow to connect to Open network when OWE is selected
+ wpa_ssid->owe_only = 1;
+ }
wpa_ssid->key_mgmt = key_mgmt_mask;
wpa_printf(MSG_MSGDUMP, "key_mgmt: 0x%x", wpa_ssid->key_mgmt);
resetInternalStateAfterParamsUpdate();