]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Set CurrentAuthMode to INACTIVE only if network is not selected
authorArisAachen <chenyunxiong@uniontech.com>
Fri, 11 Mar 2022 07:02:58 +0000 (15:02 +0800)
committerJouni Malinen <j@w1.fi>
Sat, 12 Mar 2022 08:30:26 +0000 (10:30 +0200)
CurrentAuthMode should be set as a real auth type when authentication is
in progress. wpa_supplicant has a property "State" which indicates the
authentication stage already. I think setting auth mode as "INACTIVE" in
all auth progress stages is not a good idea, because sometimes we need
to handle this connection according to the auth type even when
authentication is not complete. For example, NetworkManager may recall
ask-password-dialog when auth mode is "wpa-psk" and "sae", try next
access point when auth mode is "EAP-xx" when password is incorrect.
Since "CurrentAuthMode" is set as "INACTIVE" in all not fully completed
situations, we do not know how to handle it.

Signed-off-by: Aris Aachen <chenyunxiong@unionitech.com>
Signed-off-by: ArisAachen <chenyunxiong@uniontech.com>
wpa_supplicant/dbus/dbus_new_handlers.c

index 959a68b4cdf50f3e589371923fff41c6db22740e..1c9ded09adb1ec7c3f5cc234ce40fd12456b3fd2 100644 (file)
@@ -3951,7 +3951,7 @@ dbus_bool_t wpas_dbus_getter_current_auth_mode(
        const char *auth_mode;
        char eap_mode_buf[WPAS_DBUS_AUTH_MODE_MAX];
 
-       if (wpa_s->wpa_state != WPA_COMPLETED) {
+       if (wpa_s->wpa_state <= WPA_SCANNING) {
                auth_mode = "INACTIVE";
        } else if (wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X ||
            wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) {