Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostap: Fix wrong security printing about WPA3 PWE #83779

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MaochenWang1
Copy link
Collaborator

'wifi status' CMD shows wrong security information when STA connects to Ext-AP with WIFI_SECURITY_TYPE_SAE_HNP, after connection using WIFI_SECURITY_TYPE_SAE_AUTO. Setting sae_pwe for all the WPA3 SAE types can fix this issue.

'wifi status' CMD shows wrong security information when STA connects to
Ext-AP with WIFI_SECURITY_TYPE_SAE_HNP, after connection using
WIFI_SECURITY_TYPE_SAE_AUTO. Setting sae_pwe for all the WPA3 SAE types
can fix this issue.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Comment on lines -1024 to +1025
params->security == WIFI_SECURITY_TYPE_SAE_H2E ||
params->security == WIFI_SECURITY_TYPE_SAE_AUTO) {
params->security == WIFI_SECURITY_TYPE_SAE_H2E ||
params->security == WIFI_SECURITY_TYPE_SAE_AUTO) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not introduce no-op changes, the change looks actually wrong here becase indentation is now wrong.

Comment on lines +1050 to +1066
switch (params->security) {
case WIFI_SECURITY_TYPE_SAE_HNP:
sae_pwe = 0;
break;
case WIFI_SECURITY_TYPE_SAE_H2E:
sae_pwe = 1;
break;
case WIFI_SECURITY_TYPE_SAE_AUTO:
sae_pwe = 2;
break;
default:
sae_pwe = 0;
break;
}

if (!wpa_cli_cmd_v("set sae_pwe %d", sae_pwe)) {
goto out;
Copy link
Collaborator

@krish2718 krish2718 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index 1bd8edb857c..47035749706 100644
--- a/modules/hostap/src/supp_api.c
+++ b/modules/hostap/src/supp_api.c
@@ -1045,14 +1045,13 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
                                }
                        }
 
-                       if (params->security == WIFI_SECURITY_TYPE_SAE_H2E ||
-                           params->security == WIFI_SECURITY_TYPE_SAE_AUTO) {
-                               if (!wpa_cli_cmd_v("set sae_pwe %d",
-                                                  (params->security == WIFI_SECURITY_TYPE_SAE_H2E)
-                                                          ? 1
-                                                          : 2)) {
-                                       goto out;
-                               }
+                       if (!wpa_cli_cmd_v("set sae_pwe %d",
+                                          (params->security == WIFI_SECURITY_TYPE_SAE_H2E)
+                                                  ? 1
+                                                  : (params->security == WIFI_SECURITY_TYPE_SAE_AUTO)
+                                                          ? 2
+                                                          : 0)) {
+                               goto out;
                        }
 
                        if (!wpa_cli_cmd_v("set_network %d key_mgmt SAE%s", resp.network_id,

Isn't this a simpler change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants