From 0bea90b3267ad9a676ea9a1bf8fe677e247c7f59 Mon Sep 17 00:00:00 2001 From: Ravi Dondaputi Date: Tue, 16 Apr 2024 23:00:12 +0530 Subject: [PATCH] modules: hostap: Add support for WPA Auto security Support WPA Auto security mode wherein supplicant can implicitly choose the highest security among WPA, WPA2 and WPA3 for association with a network based on network support. Fixes SHEL-1131. Signed-off-by: Ravi Dondaputi --- modules/hostap/src/supp_api.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 50600274f269..21aea0a217ce 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -365,6 +365,17 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, _wpa_cli_cmd_v("set_network %d proto WPA", resp.network_id); } + } else if (params->security == WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL) { + if (params->sae_password) { + _wpa_cli_cmd_v("set_network %d sae_password \"%s\"", + resp.network_id, params->sae_password); + } + _wpa_cli_cmd_v("set_network %d psk \"%s\"", + resp.network_id, params->psk); + _wpa_cli_cmd_v("set_network %d key_mgmt WPA-PSK WPA-PSK-SHA256 SAE", + resp.network_id); + _wpa_cli_cmd_v("set_network %d proto WPA RSN", + resp.network_id); } else { ret = -1; wpa_printf(MSG_ERROR, "Unsupported security type: %d",