]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HS 2.0: Do not add two copies of OSEN element into Beacon/Probe Resp
authorJouni Malinen <jouni@codeaurora.org>
Fri, 30 Aug 2019 12:41:58 +0000 (15:41 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 30 Aug 2019 12:41:58 +0000 (15:41 +0300)
OSEN element was getting added both through the Authenticator IEs
(before some non-vendor elements) and separately at the end of the
frames with other vendor elements. Fix this by removing the separate
addition of the OSEN element and by moving the Authenticator IE addition
for OSEN to match the design used with WPA so that the vendor element
gets added in the proper place in the sequence of IEs.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/beacon.c

index a51b94960bed5da2243458baad4a4b7cedb86236..f3bdf30aa6bdd73834c5ff94526f9d7e08bf1971 100644 (file)
@@ -456,7 +456,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
        pos = hostapd_eid_ext_supp_rates(hapd, pos);
 
        /* RSN, MDIE */
-       if (hapd->conf->wpa != WPA_PROTO_WPA)
+       if (!(hapd->conf->wpa == WPA_PROTO_WPA ||
+             (hapd->conf->osen && !hapd->conf->wpa)))
                pos = hostapd_eid_wpa(hapd, pos, epos - pos);
 
        pos = hostapd_eid_bss_load(hapd, pos, epos - pos);
@@ -523,7 +524,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
 #endif /* CONFIG_IEEE80211AC */
 
        /* WPA */
-       if (hapd->conf->wpa == WPA_PROTO_WPA)
+       if (hapd->conf->wpa == WPA_PROTO_WPA ||
+           (hapd->conf->osen && !hapd->conf->wpa))
                pos = hostapd_eid_wpa(hapd, pos, epos - pos);
 
        /* Wi-Fi Alliance WMM */
@@ -553,7 +555,6 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
 
 #ifdef CONFIG_HS20
        pos = hostapd_eid_hs20_indication(hapd, pos);
-       pos = hostapd_eid_osen(hapd, pos);
 #endif /* CONFIG_HS20 */
 
        pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos);
@@ -1164,7 +1165,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
        tailpos = hostapd_eid_ext_supp_rates(hapd, tailpos);
 
        /* RSN, MDIE */
-       if (hapd->conf->wpa != WPA_PROTO_WPA)
+       if (!(hapd->conf->wpa == WPA_PROTO_WPA ||
+             (hapd->conf->osen && !hapd->conf->wpa)))
                tailpos = hostapd_eid_wpa(hapd, tailpos,
                                          tail + BEACON_TAIL_BUF_SIZE -
                                          tailpos);
@@ -1240,7 +1242,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 #endif /* CONFIG_IEEE80211AC */
 
        /* WPA */
-       if (hapd->conf->wpa == WPA_PROTO_WPA)
+       if (hapd->conf->wpa == WPA_PROTO_WPA ||
+           (hapd->conf->osen && !hapd->conf->wpa))
                tailpos = hostapd_eid_wpa(hapd, tailpos,
                                          tail + BEACON_TAIL_BUF_SIZE -
                                          tailpos);
@@ -1271,7 +1274,6 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 
 #ifdef CONFIG_HS20
        tailpos = hostapd_eid_hs20_indication(hapd, tailpos);
-       tailpos = hostapd_eid_osen(hapd, tailpos);
 #endif /* CONFIG_HS20 */
 
        tailpos = hostapd_eid_mbo(hapd, tailpos, tail + tail_len - tailpos);