From 524c452153f68b599a001f8ca6265ef772882beb Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 30 Jul 2024 12:15:02 +0300 Subject: [PATCH] RSNO: Remove unused override element generation The separate RSNOE/RSNO2E/RSNXOE buffers were not actually used on the Authenticator, so remove them. Signed-off-by: Jouni Malinen --- src/ap/wpa_auth.c | 3 -- src/ap/wpa_auth_i.h | 3 -- src/ap/wpa_auth_ie.c | 74 -------------------------------------------- 3 files changed, 80 deletions(-) diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index 68a868a00..e0d09abf7 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -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) { diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h index 29988c27e..9f47b2961 100644 --- a/src/ap/wpa_auth_i.h +++ b/src/ap/wpa_auth_i.h @@ -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]; diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c index 6161edef1..11e3ab16f 100644 --- a/src/ap/wpa_auth_ie.c +++ b/src/ap/wpa_auth_ie.c @@ -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; }