aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-10-18 12:49:32 (GMT)
committerJouni Malinen <j@w1.fi>2019-10-18 12:49:32 (GMT)
commitcb99259775c14fab4efaf0f48ae14c5669a7a137 (patch)
tree51f4a9fc040f28f6d466a5359cc413ee7baa0103
parent30628e0d2d1cc8bc285d9358e0f1f25d4b573c93 (diff)
downloadhostap-cb99259775c14fab4efaf0f48ae14c5669a7a137.zip
hostap-cb99259775c14fab4efaf0f48ae14c5669a7a137.tar.gz
hostap-cb99259775c14fab4efaf0f48ae14c5669a7a137.tar.bz2
Add RSNXE into (Re)Association Response frames
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>
-rw-r--r--src/ap/ap_drv_ops.c4
-rw-r--r--src/ap/ieee802_11.c2
-rw-r--r--src/ap/ieee802_11.h1
-rw-r--r--src/ap/ieee802_11_shared.c19
4 files changed, 26 insertions, 0 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 45d46fe..de60c79 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -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;
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index c45009c..306e989 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -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 &&
diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
index b8453c9..f592da5 100644
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -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 */
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 5007088..f24963e 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -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;
+}