]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SME: Fix IBSS setup after shared key/FT/FILS association
authorJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 16:23:13 +0000 (18:23 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 16:23:13 +0000 (18:23 +0200)
wpa_s->sme.auth_alg could have been left to a previously value other
than WPA_AUTH_ALG_OPEN if IBSS network is used after an association that
used shared key, FT, or FILS authentication algorithm. This could result
in the IBSS setup failing due to incorrect authentication processing
steps.

Fix this by setting wpa_s->sme.auth_alg = WPA_AUTH_ALG_OPEN whenever
starting an IBSS (or mesh, for that matter) network.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index 0bfc39ddb19ded5e522cbdbc754be95dbf18fec7..330b52ee4be2b6f5c2c3ce4366763a78777034c3 100644 (file)
@@ -1798,6 +1798,13 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                return;
        }
 
+#ifdef CONFIG_SME
+       if (ssid->mode == WPAS_MODE_IBSS || ssid->mode == WPAS_MODE_MESH) {
+               /* Clear possibly set auth_alg, if any, from last attempt. */
+               wpa_s->sme.auth_alg = WPA_AUTH_ALG_OPEN;
+       }
+#endif /* CONFIG_SME */
+
        wpas_abort_ongoing_scan(wpa_s);
 
        cwork = os_zalloc(sizeof(*cwork));