From a8bfc6fff24218adc0902ba19843865d407262d8 Mon Sep 17 00:00:00 2001 From: Ankita Bajaj Date: Thu, 5 Sep 2019 19:47:55 +0530 Subject: [PATCH] FILS: Update connect params after sending connection notification 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 --- wpa_supplicant/wpa_supplicant.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index b92c61ef0..a15f6373d 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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 */ }