[PATCH v2] wpa:change state to AUTHENTICATING after trigger external_auth ok

xinpeng wang wangxinpeng at uniontech.com
Mon Nov 7 22:47:36 PST 2022

When the connection to wifi fails, nm judges whether recall
ask-password-dialog according to the status change of wpa; for sae, if it
is in external authentication mode, when the authentication fails, the
state is from ASSOCIATING to DISCONNECTED; if it is not external
authentication, when the authentication fails, the state is AUTHENTICATING
To DISCONNECTED. Therefore, nm needs to ask for a password when the state
of wpa changes from AUTHENTICATING or ASSOCIATING to DISCONNECTED when sae.
This range is too large, and there may be misjudgments. Therefore, consider
changing the status to AUTHENTICATING for the successful triggering of
external authentication.
Because sme_handle_external_auth_start will always succeed, even if wifi
doesn't exist at this time. So change the state after receiving the
response from the ap for the first time.

Signed-off-by: xinpeng wang <wangxinpeng at uniontech.com>
 wpa_supplicant/sme.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 28ac03f23..2126e085d 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -1506,8 +1506,10 @@ static int sme_sae_auth(struct wpa_supplicant *wpa_s, u16 auth_transaction,
 		if (!external)
 			sme_send_authentication(wpa_s, wpa_s->current_bss,
 						wpa_s->current_ssid, 0);
-		else
+		else {
 			sme_external_auth_send_sae_confirm(wpa_s, sa);
+			wpa_supplicant_set_state(wpa_s,WPA_AUTHENTICATING);
+		}
 		return 0;
 	} else if (auth_transaction == 2) {
 		if (status_code != WLAN_STATUS_SUCCESS)

More information about the Hostap mailing list