]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FT: Add FT auth algorithm to connect params when roaming
authorAhmad Masri <amasri@codeaurora.org>
Mon, 16 Apr 2018 10:30:42 +0000 (13:30 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 19 Apr 2018 21:35:41 +0000 (00:35 +0300)
Add WPA FT auth to connect params in case of a re-connection to ESS
supporting FT when FT was used in the first connect.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
src/drivers/driver_nl80211.c
wpa_supplicant/wpa_supplicant.c

index 7570d12152aaf186d01a81be5359b6277bddf84e..66b69892b57af9b0c14d6aae6f2f49dae62934e2 100644 (file)
@@ -5505,6 +5505,8 @@ static int wpa_driver_nl80211_try_connect(
                algs++;
        if (params->auth_alg & WPA_AUTH_ALG_FILS)
                algs++;
+       if (params->auth_alg & WPA_AUTH_ALG_FT)
+               algs++;
        if (algs > 1) {
                wpa_printf(MSG_DEBUG, "  * Leave out Auth Type for automatic "
                           "selection");
index c8f4802a9ce3cae883f86f0723959ca6f0810f60..dcd787becbe82979bc365f63fc399427d550bed9 100644 (file)
@@ -2725,16 +2725,26 @@ static u8 * wpas_populate_assoc_ies(
                const u8 *mdie = wpa_bss_get_ie(bss, WLAN_EID_MOBILITY_DOMAIN);
 
                if (mdie && mdie[1] >= MOBILITY_DOMAIN_ID_LEN) {
+                       size_t len = 0;
                        const u8 *md = mdie + 2;
                        const u8 *wpa_md = wpa_sm_get_ft_md(wpa_s->wpa);
 
                        if (os_memcmp(md, wpa_md,
                                      MOBILITY_DOMAIN_ID_LEN) == 0) {
                                /* Add mobility domain IE */
-                               wpa_ie_len += wpa_ft_add_mdie(
+                               len = wpa_ft_add_mdie(
                                        wpa_s->wpa, wpa_ie + wpa_ie_len,
                                        max_wpa_ie_len - wpa_ie_len, mdie);
+                               wpa_ie_len += len;
                        }
+#ifdef CONFIG_SME
+                       if (len > 0 && wpa_s->sme.ft_used &&
+                           wpa_sm_has_ptk(wpa_s->wpa)) {
+                               wpa_dbg(wpa_s, MSG_DEBUG,
+                                       "SME: Trying to use FT over-the-air");
+                               algs |= WPA_AUTH_ALG_FT;
+                       }
+#endif /* CONFIG_SME */
                }
        }
 #endif /* CONFIG_IEEE80211R */