hostap: Fix WPA version for WPA3 and WPA2-PSK-256

The WPA version was only been set for WPA-PSK and WPA2-PSK, but for
others it wasn't set. For AP mode this causes issues as WPA-IE is
considered and WPA3/WPA2-PSK-256 aren't allowed, they need RSN.

Explicitly set the version for all to RSN, except for WPA-PSK.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2024-01-17 00:56:55 +05:30 committed by Alberto Escolar
parent d8600d57cc
commit 2a144e8bfe

View file

@ -377,6 +377,14 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
}
if (params->security != WIFI_SECURITY_TYPE_NONE) {
/* Except for WPA-PSK, rest all are under WPA2 */
if (params->security != WIFI_SECURITY_TYPE_WPA_PSK) {
if (!wpa_cli_cmd_v("set_network %d proto RSN",
resp.network_id)) {
goto out;
}
}
if (params->security == WIFI_SECURITY_TYPE_SAE) {
if (params->sae_password) {
if (!wpa_cli_cmd_v("set_network %d sae_password \"%s\"",
@ -420,11 +428,6 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
resp.network_id)) {
goto out;
}
} else {
if (!wpa_cli_cmd_v("set_network %d proto RSN",
resp.network_id)) {
goto out;
}
}
} else {
ret = -1;