]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SME: Drop old disassoc_while_authenticating workaround
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 20 Nov 2023 23:51:16 +0000 (01:51 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 24 Nov 2023 20:59:19 +0000 (22:59 +0200)
This workaround from commit 6d6f4bb87f33 ("nl80211: Work around mac80211
limitation on (re)auth when authenticated") pre-dates the code that
supresses the deauth or disconnect event from nl80211. Should this code
be called it would not actually work at this point, as important
internal state for the authentication attempt has already been lost.

Simply drop the code. This might also fix issues where we could get
into a bad state if a proper deauth/disconnect event happens while we
are authenticating or associating.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
wpa_supplicant/events.c
wpa_supplicant/sme.c
wpa_supplicant/sme.h

index e9d6d0244d7e4d6f66ba91d671fea2aaf7653cdc..b1a2fc6f98bfb299c04a6975c2e809646a8533ba 100644 (file)
@@ -4151,16 +4151,10 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
                                                 int locally_generated)
 {
        const u8 *bssid;
-       int authenticating;
-       u8 prev_pending_bssid[ETH_ALEN];
        struct wpa_bss *fast_reconnect = NULL;
        struct wpa_ssid *fast_reconnect_ssid = NULL;
-       struct wpa_ssid *last_ssid;
        struct wpa_bss *curr = NULL;
 
-       authenticating = wpa_s->wpa_state == WPA_AUTHENTICATING;
-       os_memcpy(prev_pending_bssid, wpa_s->pending_bssid, ETH_ALEN);
-
        if (wpa_s->key_mgmt == WPA_KEY_MGMT_WPA_NONE) {
                /*
                 * At least Host AP driver and a Prism3 card seemed to be
@@ -4190,7 +4184,7 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
                        "pre-shared key may be incorrect");
                if (wpas_p2p_4way_hs_failed(wpa_s) > 0)
                        return; /* P2P group removed */
-               wpas_auth_failed(wpa_s, "WRONG_KEY", prev_pending_bssid);
+               wpas_auth_failed(wpa_s, "WRONG_KEY", wpa_s->pending_bssid);
                wpas_notify_psk_mismatch(wpa_s);
 #ifdef CONFIG_DPP2
                wpas_dpp_send_conn_status_result(wpa_s,
@@ -4254,17 +4248,11 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
                wpa_dbg(wpa_s, MSG_DEBUG, "Disconnect event - remove keys");
                wpa_clear_keys(wpa_s, wpa_s->bssid);
        }
-       last_ssid = wpa_s->current_ssid;
        wpa_supplicant_mark_disassoc(wpa_s);
 
        if (curr)
                wpa_bss_remove(wpa_s, curr, "Connection to AP lost");
 
-       if (authenticating && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)) {
-               sme_disassoc_while_authenticating(wpa_s, prev_pending_bssid);
-               wpa_s->current_ssid = last_ssid;
-       }
-
        if (fast_reconnect &&
            !wpas_network_disabled(wpa_s, fast_reconnect_ssid) &&
            !disallowed_bssid(wpa_s, fast_reconnect->bssid) &&
index 5faa03869091e02f954f1f591fec4561eeaf31be..8c81824f095a4265c522b727544e2dc87986668e 100644 (file)
@@ -2888,28 +2888,6 @@ void sme_state_changed(struct wpa_supplicant *wpa_s)
 }
 
 
-void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
-                                      const u8 *prev_pending_bssid)
-{
-       /*
-        * mac80211-workaround to force deauth on failed auth cmd,
-        * requires us to remain in authenticating state to allow the
-        * second authentication attempt to be continued properly.
-        */
-       wpa_dbg(wpa_s, MSG_DEBUG, "SME: Allow pending authentication "
-               "to proceed after disconnection event");
-       wpa_supplicant_set_state(wpa_s, WPA_AUTHENTICATING);
-       os_memcpy(wpa_s->pending_bssid, prev_pending_bssid, ETH_ALEN);
-
-       /*
-        * Re-arm authentication timer in case auth fails for whatever reason.
-        */
-       eloop_cancel_timeout(sme_auth_timer, wpa_s, NULL);
-       eloop_register_timeout(SME_AUTH_TIMEOUT, 0, sme_auth_timer, wpa_s,
-                              NULL);
-}
-
-
 void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s)
 {
        wpa_s->sme.prev_bssid_set = 0;
index c797d2e9e796eac5050c96f0ebf60334121ba250..50524d13184e9b0adce452334259b50ddc1e8c31 100644 (file)
@@ -32,8 +32,6 @@ void sme_event_ch_switch(struct wpa_supplicant *wpa_s);
 void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *da, const u8 *sa,
                     const u8 *data, size_t len);
 void sme_state_changed(struct wpa_supplicant *wpa_s);
-void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
-                                      const u8 *prev_pending_bssid);
 void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s);
 void sme_deinit(struct wpa_supplicant *wpa_s);
 
@@ -98,12 +96,6 @@ static inline void sme_state_changed(struct wpa_supplicant *wpa_s)
 {
 }
 
-static inline void
-sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
-                                 const u8 *prev_pending_bssid)
-{
-}
-
 static inline void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s)
 {
 }