]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Advertise Extended RSN Capabilities when H2E is enabled
authorJouni Malinen <jouni@codeaurora.org>
Thu, 5 Sep 2019 09:05:58 +0000 (12:05 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 15 Oct 2019 12:39:22 +0000 (15:39 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/wpa_auth_i.h
src/ap/wpa_auth_ie.c

index 0d3ab27a2821433af39d31a9e45f0aa29090cfe2..f568a90c89617fd3894acaabcd26f03bd4d25cdb 100644 (file)
@@ -267,6 +267,7 @@ struct ft_remote_seq {
 
 int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
                     const u8 *pmkid);
+int wpa_write_rsnxe(struct wpa_auth_config *conf, u8 *buf, size_t len);
 void wpa_auth_logger(struct wpa_authenticator *wpa_auth, const u8 *addr,
                     logger_level level, const char *txt);
 void wpa_auth_vlogger(struct wpa_authenticator *wpa_auth, const u8 *addr,
index a285e25940c0e520fcd94f2c17ebd053f0c93b15..4b0e279dcf29d2b9d9641b8ee4b13bdcde776a87 100644 (file)
@@ -372,6 +372,26 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
 }
 
 
+int wpa_write_rsnxe(struct wpa_auth_config *conf, u8 *buf, size_t len)
+{
+       u8 *pos = buf;
+
+       if (conf->sae_pwe != 1 && conf->sae_pwe != 2)
+               return 0; /* no supported extended RSN capabilities */
+
+       if (len < 3)
+               return -1;
+
+       *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 - buf;
+}
+
+
 static u8 * wpa_write_osen(struct wpa_auth_config *conf, u8 *eid)
 {
        u8 *len;
@@ -456,6 +476,11 @@ int wpa_auth_gen_wpa_ie(struct wpa_authenticator *wpa_auth)
                if (res < 0)
                        return res;
                pos += res;
+               res = wpa_write_rsnxe(&wpa_auth->conf, pos,
+                                     buf + sizeof(buf) - pos);
+               if (res < 0)
+                       return res;
+               pos += res;
        }
 #ifdef CONFIG_IEEE80211R_AP
        if (wpa_key_mgmt_ft(wpa_auth->conf.wpa_key_mgmt)) {