]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix AP IE in EAPOL-Key 3/4 for WPA + FT combination
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 12 Dec 2014 12:03:36 +0000 (14:03 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 12 Dec 2014 12:03:36 +0000 (14:03 +0200)
Previously, only WPA + WPA2 was covered. If FT is enabled in addition to
WPA, MDIE is included in the buffer between RSN and WPA elements. The
previous version ended up leaving only the MDIE after having skipped RSN
element. Fix this to skip MDIE as well to leave only WPA IE regardless
of whether FT is enabled in AP configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/wpa_auth.c

index c422044adc1825ca5ceb239d9fa2851865af85a0..da2073c0a22af7dd37be2f88bd25e5f2bc0fdd22 100644 (file)
@@ -2118,8 +2118,10 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
        if (sm->wpa == WPA_VERSION_WPA &&
            (sm->wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
            wpa_ie_len > wpa_ie[1] + 2 && wpa_ie[0] == WLAN_EID_RSN) {
-               /* WPA-only STA, remove RSN IE */
+               /* WPA-only STA, remove RSN IE and possible MDIE */
                wpa_ie = wpa_ie + wpa_ie[1] + 2;
+               if (wpa_ie[0] == WLAN_EID_MOBILITY_DOMAIN)
+                       wpa_ie = wpa_ie + wpa_ie[1] + 2;
                wpa_ie_len = wpa_ie[1] + 2;
        }
        wpa_auth_logger(sm->wpa_auth, sm->addr, LOGGER_DEBUG,