dbus: Set CurrentAuthMode to INACTIVE only if network is not selected

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>
This commit is contained in:
ArisAachen 2022-03-11 15:02:58 +08:00 committed by Jouni Malinen
parent 0ce8d55a2e
commit 3a157fe92f

View file

@ -3951,7 +3951,7 @@ dbus_bool_t wpas_dbus_getter_current_auth_mode(
const char *auth_mode; const char *auth_mode;
char eap_mode_buf[WPAS_DBUS_AUTH_MODE_MAX]; 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"; auth_mode = "INACTIVE";
} else if (wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X || } else if (wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X ||
wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) { wpa_s->key_mgmt == WPA_KEY_MGMT_IEEE8021X_NO_WPA) {