]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Add FILS Indication element to Beacon and Probe Response frames
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 1 Sep 2015 16:33:32 +0000 (19:33 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 10 Oct 2016 18:11:46 +0000 (21:11 +0300)
If FILS is enabled, indicate that in AP Beacon/Probe Response frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/beacon.c
src/ap/ieee802_11.h
src/ap/ieee802_11_shared.c

index 233320d2e978cfa1a7f87a5d54e8fbe84eb08efe..474ff597344db35002d8237a6a498ea9c6584463 100644 (file)
@@ -491,6 +491,11 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
                pos = hostapd_eid_txpower_envelope(hapd, pos);
                pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
        }
+#endif /* CONFIG_IEEE80211AC */
+
+       pos = hostapd_eid_fils_indic(hapd, pos, 0);
+
+#ifdef CONFIG_IEEE80211AC
        if (hapd->conf->vendor_vht)
                pos = hostapd_eid_vendor_vht(hapd, pos);
 #endif /* CONFIG_IEEE80211AC */
@@ -1155,6 +1160,11 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
                tailpos = hostapd_eid_txpower_envelope(hapd, tailpos);
                tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos);
        }
+#endif /* CONFIG_IEEE80211AC */
+
+       tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0);
+
+#ifdef CONFIG_IEEE80211AC
        if (hapd->conf->vendor_vht)
                tailpos = hostapd_eid_vendor_vht(hapd, tailpos);
 #endif /* CONFIG_IEEE80211AC */
index 0327dec2a2bc30bfde6e1de5368c92ee082c5a9d..d5627dc4483d4c4212c45e115a66e4abe8954808 100644 (file)
@@ -135,4 +135,6 @@ void ap_copy_sta_supp_op_classes(struct sta_info *sta,
                                 const u8 *supp_op_classes,
                                 size_t supp_op_classes_len);
 
+u8 * hostapd_eid_fils_indic(struct hostapd_data *hapd, u8 *eid, int hessid);
+
 #endif /* IEEE802_11_H */
index 259413bd12ffbc5bafa414259fd7dc10ba206e6c..4b5867b2df2f33d6432b9de90d96fe195e27a97b 100644 (file)
@@ -584,3 +584,45 @@ void ap_copy_sta_supp_op_classes(struct sta_info *sta,
        os_memcpy(sta->supp_op_classes + 1, supp_op_classes,
                  supp_op_classes_len);
 }
+
+
+u8 * hostapd_eid_fils_indic(struct hostapd_data *hapd, u8 *eid, int hessid)
+{
+       u8 *pos = eid;
+#ifdef CONFIG_FILS
+       u8 *len;
+       u16 fils_info = 0;
+
+       if (!(hapd->conf->wpa & WPA_PROTO_RSN) ||
+           !wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt))
+               return pos;
+
+       *pos++ = WLAN_EID_FILS_INDICATION;
+       len = pos++;
+       /* TODO: B0..B2: Number of Public Key Identifiers */
+       /* TODO: B3..B5: Number of Realm Identifiers */
+       /* TODO: B6: FILS IP Address Configuration */
+       if (hapd->conf->fils_cache_id_set)
+               fils_info |= BIT(7);
+       if (hessid && !is_zero_ether_addr(hapd->conf->hessid))
+               fils_info |= BIT(8); /* HESSID Included */
+       /* FILS Shared Key Authentication without PFS Supported */
+       fils_info |= BIT(9);
+       /* TODO: B10: FILS Shared Key Authentication with PFS Supported */
+       /* TODO: B11: FILS Public Key Authentication Supported */
+       /* B12..B15: Reserved */
+       WPA_PUT_LE16(pos, fils_info);
+       pos += 2;
+       if (hapd->conf->fils_cache_id_set) {
+               os_memcpy(pos, hapd->conf->fils_cache_id, FILS_CACHE_ID_LEN);
+               pos += FILS_CACHE_ID_LEN;
+       }
+       if (hessid && !is_zero_ether_addr(hapd->conf->hessid)) {
+               os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
+               pos += ETH_ALEN;
+       }
+       *len = pos - len - 1;
+#endif /* CONFIG_FILS */
+
+       return pos;
+}