]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add RSNXE into (Re)Association Response frames
authorJouni Malinen <jouni@codeaurora.org>
Fri, 18 Oct 2019 12:49:32 +0000 (15:49 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 18 Oct 2019 12:49:32 +0000 (15:49 +0300)
Add the new RSNXE into (Re)Association Response frames if any of the
capability bits is nonzero.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/ap_drv_ops.c
src/ap/ieee802_11.c
src/ap/ieee802_11.h
src/ap/ieee802_11_shared.c

index 45d46febd8981e675fcfbb2abd619b8fc4db7c91..de60c79fa26242829657371bcfed8699c88bc5d8 100644 (file)
@@ -107,6 +107,10 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
                goto fail;
 #endif /* CONFIG_FILS */
 
+       pos = hostapd_eid_rsnxe(hapd, buf, sizeof(buf));
+       if (add_buf_data(&assocresp, buf, pos - buf) < 0)
+               goto fail;
+
        if (add_buf(&beacon, hapd->wps_beacon_ie) < 0 ||
            add_buf(&proberesp, hapd->wps_probe_resp_ie) < 0)
                goto fail;
index c45009cedafe65faac2ce4fa23e8b097e7a57035..306e989783156ff6000acd75d408963e907bbb4c 100644 (file)
@@ -3717,6 +3717,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
        }
 #endif /* CONFIG_FST */
 
+       p = hostapd_eid_rsnxe(hapd, p, buf + buflen - p);
+
 #ifdef CONFIG_OWE
        if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) &&
            sta && sta->owe_ecdh && status_code == WLAN_STATUS_SUCCESS &&
index b8453c992a9c8ce99328e3f7929baa39bd033808..f592da54af5ac168adf36d4777283dd26dcc971e 100644 (file)
@@ -192,5 +192,6 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
                      int ap_seg1_idx, int *bandwidth, int *seg1_idx);
 
 void auth_sae_process_commit(void *eloop_ctx, void *user_ctx);
+u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len);
 
 #endif /* IEEE802_11_H */
index 5007088b5aabaf0a026c41800b683726e9209fe0..f24963e16d879ac55859e69ebad214b4c0ea1f41 100644 (file)
@@ -996,3 +996,22 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
        return 0;
 }
 #endif /* CONFIG_OCV */
+
+
+u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len)
+{
+       u8 *pos = eid;
+
+       if (!(hapd->conf->wpa & WPA_PROTO_RSN) ||
+           (hapd->conf->sae_pwe != 1 && hapd->conf->sae_pwe != 2) ||
+           len < 3)
+               return pos;
+
+       *pos++ = WLAN_EID_RSNX;
+       *pos++ = 1;
+       /* bits 0-3 = 0 since only one octet of Extended RSN Capabilities is
+        * used for now */
+       *pos++ = BIT(WLAN_RSNX_CAPAB_SAE_H2E);
+
+       return pos;
+}