]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Track completion with FILS shared key authentication offload
authorVidyullatha Kanchanapally <vkanchan@qti.qualcomm.com>
Wed, 22 Mar 2017 10:40:05 +0000 (16:10 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 7 Apr 2017 15:46:13 +0000 (18:46 +0300)
Update the internal fils_completed state when offloading FILS shared key
authentication to the driver.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 8bd5538033ed57003f84f131905bd763035e44b4..c863ce41be17db67f56a9775a31de0c326b2a869 100644 (file)
@@ -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 */
 
 
index 3f99a1b3096268ebf5209da146e83c95e05e0668..2f41c230c5cacd521b17981617d1b241ad35c34d 100644 (file)
@@ -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 */
index f81a7c53e5a7f102d8dcf6b2556ffb52595b3b03..127746bec44bbed085c073ae80b5bcf813af45b1 100644 (file)
@@ -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,
index 1e46deaee8677551a16915924a0ab99380e6e58c..498820a3d9b098b618b25f5018bf241ed5c6199c 100644 (file)
@@ -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++) {
index 36d001d7910c9d0e679898f8d1ac85b81328b198..45dc05c7f4218169fe48453351307a51cbd13df3 100644 (file)
@@ -748,6 +748,7 @@ struct wpa_supplicant {
        int sta_uapsd;
        int set_ap_uapsd;
        int ap_uapsd;
+       int auth_alg;
 
 #ifdef CONFIG_SME
        struct {