From: Vidyullatha Kanchanapally Date: Wed, 22 Mar 2017 10:40:05 +0000 (+0530) Subject: FILS: Track completion with FILS shared key authentication offload X-Git-Tag: hostap_2_7~1390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5538fc930988bfc12935579b2b9930d18ffd1be8;p=thirdparty%2Fhostap.git FILS: Track completion with FILS shared key authentication offload Update the internal fils_completed state when offloading FILS shared key authentication to the driver. Signed-off-by: Jouni Malinen --- diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 8bd553803..c863ce41b 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -3909,6 +3909,13 @@ fail: return -1; } + +void wpa_sm_set_reset_fils_completed(struct wpa_sm *sm, int set) +{ + if (sm) + sm->fils_completed = !!set; +} + #endif /* CONFIG_FILS */ diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h index 3f99a1b30..2f41c230c 100644 --- a/src/rsn_supp/wpa.h +++ b/src/rsn_supp/wpa.h @@ -451,4 +451,6 @@ struct wpabuf * owe_build_assoc_req(struct wpa_sm *sm); int owe_process_assoc_resp(struct wpa_sm *sm, const u8 *resp_ies, size_t resp_ies_len); +void wpa_sm_set_reset_fils_completed(struct wpa_sm *sm, int set); + #endif /* WPA_H */ diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index f81a7c53e..127746bec 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2223,6 +2223,11 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s, return -1; } #endif /* CONFIG_SME */ + + /* Additional processing for FILS when SME is in driver */ + if (wpa_s->auth_alg == WPA_AUTH_ALG_FILS && + !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)) + wpa_sm_set_reset_fils_completed(wpa_s->wpa, 1); #endif /* CONFIG_FILS */ #ifdef CONFIG_OWE @@ -3681,7 +3686,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, } #endif /* CONFIG_TESTING_OPTIONS */ wpa_supplicant_event_assoc(wpa_s, data); - if (data && data->assoc_info.authorized) + if ((data && data->assoc_info.authorized) || + (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && + wpa_fils_is_completed(wpa_s->wpa))) wpa_supplicant_event_assoc_auth(wpa_s, data); if (data) { wpa_msg(wpa_s, MSG_INFO, diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 1e46deaee..498820a3d 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2288,6 +2288,9 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) } #ifdef CONFIG_FILS + /* Clear FILS association */ + wpa_sm_set_reset_fils_completed(wpa_s->wpa, 0); + if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD) && ssid->eap.erp && wpa_key_mgmt_fils(ssid->key_mgmt) && eapol_sm_get_erp_info(wpa_s->eapol, &ssid->eap, &username, @@ -2593,6 +2596,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) params.key_mgmt_suite = wpa_s->key_mgmt; params.wpa_proto = wpa_s->wpa_proto; params.auth_alg = algs; + wpa_s->auth_alg = params.auth_alg; params.mode = ssid->mode; params.bg_scan_period = ssid->bg_scan_period; for (i = 0; i < NUM_WEP_KEYS; i++) { diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 36d001d79..45dc05c7f 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -748,6 +748,7 @@ struct wpa_supplicant { int sta_uapsd; int set_ap_uapsd; int ap_uapsd; + int auth_alg; #ifdef CONFIG_SME struct {