]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RSNO: Remove unused override element generation
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 30 Jul 2024 09:15:02 +0000 (12:15 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 30 Jul 2024 09:16:05 +0000 (12:16 +0300)
The separate RSNOE/RSNO2E/RSNXOE buffers were not actually used on the
Authenticator, so remove them.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/wpa_auth.c
src/ap/wpa_auth_i.h
src/ap/wpa_auth_ie.c

index 68a868a0088db070426a895da4d2179bfe71dd69..e0d09abf7d74c155ffd28086637f5370f48581ff 100644 (file)
@@ -885,9 +885,6 @@ void wpa_deinit(struct wpa_authenticator *wpa_auth)
 
 
        os_free(wpa_auth->wpa_ie);
-       os_free(wpa_auth->rsne_override);
-       os_free(wpa_auth->rsne_override_2);
-       os_free(wpa_auth->rsnxe_override);
 
        group = wpa_auth->group;
        while (group) {
index 29988c27e6dbff1a58b36e9a233e178e306a290f..9f47b2961d81f6ec15d006574a6884435ac8477e 100644 (file)
@@ -251,9 +251,6 @@ struct wpa_authenticator {
 
        u8 *wpa_ie;
        size_t wpa_ie_len;
-       u8 *rsne_override; /* RSNE with overridden payload */
-       u8 *rsne_override_2; /* RSNE with overridden (2) payload */
-       u8 *rsnxe_override; /* RSNXE with overridden payload */
 
        u8 addr[ETH_ALEN];
 
index 6161edef1756981cbd15616d07e4cf07fe1a7946..11e3ab16f07bb2791590e0ab55a57be76a7d792a 100644 (file)
@@ -810,80 +810,6 @@ done:
        os_memcpy(wpa_auth->wpa_ie, buf, pos - buf);
        wpa_auth->wpa_ie_len = pos - buf;
 
-       if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
-           wpa_auth->conf.rsn_override_key_mgmt) {
-#ifdef CONFIG_TESTING_OPTIONS
-               if (wpa_auth->conf.rsnoe_override_set) {
-                       os_memcpy(buf, wpa_auth->conf.rsnoe_override,
-                                 wpa_auth->conf.rsnoe_override_len);
-                       res = wpa_auth->conf.rsnoe_override_len;
-               } else
-#endif /* CONFIG_TESTING_OPTIONS */
-               res = wpa_write_rsne_override(&wpa_auth->conf, buf,
-                                             sizeof(buf));
-               if (res < 0)
-                       return res;
-               os_free(wpa_auth->rsne_override);
-               wpa_auth->rsne_override = os_malloc(res - 4);
-               if (!wpa_auth->rsne_override)
-                       return -1;
-               pos = wpa_auth->rsne_override;
-               *pos++ = WLAN_EID_RSN;
-               *pos++ = res - 2 - 4;
-               os_memcpy(pos, &buf[2 + 4], res - 2 - 4);
-       }
-
-       if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
-           wpa_auth->conf.rsn_override_key_mgmt_2) {
-#ifdef CONFIG_TESTING_OPTIONS
-               if (wpa_auth->conf.rsno2e_override_set) {
-                       os_memcpy(buf, wpa_auth->conf.rsno2e_override,
-                                 wpa_auth->conf.rsno2e_override_len);
-                       res = wpa_auth->conf.rsno2e_override_len;
-               } else
-#endif /* CONFIG_TESTING_OPTIONS */
-               res = wpa_write_rsne_override_2(&wpa_auth->conf, buf,
-                                               sizeof(buf));
-               if (res < 0)
-                       return res;
-               os_free(wpa_auth->rsne_override_2);
-               wpa_auth->rsne_override_2 = os_malloc(res - 4);
-               if (!wpa_auth->rsne_override_2)
-                       return -1;
-               pos = wpa_auth->rsne_override_2;
-               *pos++ = WLAN_EID_RSN;
-               *pos++ = res - 2 - 4;
-               os_memcpy(pos, &buf[2 + 4], res - 2 - 4);
-       }
-
-       if ((wpa_auth->conf.wpa & WPA_PROTO_RSN) &&
-           (wpa_auth->conf.rsn_override_key_mgmt ||
-            wpa_auth->conf.rsn_override_key_mgmt_2)) {
-#ifdef CONFIG_TESTING_OPTIONS
-               if (wpa_auth->conf.rsnxoe_override_set) {
-                       os_memcpy(buf, wpa_auth->conf.rsnxoe_override,
-                                 wpa_auth->conf.rsnxoe_override_len);
-                       res = wpa_auth->conf.rsnxoe_override_len;
-               } else
-#endif /* CONFIG_TESTING_OPTIONS */
-               res = wpa_write_rsnxe_override(&wpa_auth->conf, buf,
-                                              sizeof(buf));
-               if (res < 0)
-                       return res;
-               os_free(wpa_auth->rsnxe_override);
-               if (res == 0) {
-                       wpa_auth->rsnxe_override = NULL;
-                       return 0;
-               }
-               wpa_auth->rsnxe_override = os_malloc(res - 4);
-               if (!wpa_auth->rsnxe_override)
-                       return -1;
-               pos = wpa_auth->rsnxe_override;
-               *pos++ = WLAN_EID_RSNX;
-               *pos++ = res - 2 - 4;
-               os_memcpy(pos, &buf[2 + 4], res - 2 - 4);
-       }
-
        return 0;
 }