]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Update connect params after sending connection notification
authorAnkita Bajaj <bankita@codeaurora.org>
Thu, 5 Sep 2019 14:17:55 +0000 (19:47 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 8 Sep 2019 14:50:23 +0000 (17:50 +0300)
Update connect params will update auth_alg and fils_hlp_req in
wpa_supplicant structure before calling function
wpas_notify_state_changed(). This could have resulted in triggering
inconsistent state change events and messages in the Android framework.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/wpa_supplicant.c

index b92c61ef02fe20d1ae51733f4cae17aa1302e4fc..a15f6373d43055a1fef841a6f6859d1b2c4b03e0 100644 (file)
@@ -840,6 +840,9 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
                              enum wpa_states state)
 {
        enum wpa_states old_state = wpa_s->wpa_state;
+#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
+       Boolean update_fils_connect_params = FALSE;
+#endif /* CONFIG_FILS && IEEE8021X_EAPOL */
 
        wpa_dbg(wpa_s, MSG_DEBUG, "State: %s -> %s",
                wpa_supplicant_state_txt(wpa_s->wpa_state),
@@ -937,7 +940,7 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
 
 #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
                if (!fils_hlp_sent && ssid && ssid->eap.erp)
-                       wpas_update_fils_connect_params(wpa_s);
+                       update_fils_connect_params = TRUE;
 #endif /* CONFIG_FILS && IEEE8021X_EAPOL */
 #ifdef CONFIG_OWE
                if (ssid && (ssid->key_mgmt & WPA_KEY_MGMT_OWE))
@@ -983,6 +986,10 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
                    old_state == WPA_COMPLETED)
                        wpas_notify_auth_changed(wpa_s);
        }
+#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
+       if (update_fils_connect_params)
+               wpas_update_fils_connect_params(wpa_s);
+#endif /* CONFIG_FILS && IEEE8021X_EAPOL */
 }