[openwrt/openwrt] hostapd: remove workaround for broken WPA IEs in ancient devices
LEDE Commits
lede-commits at lists.infradead.org
Thu Apr 4 04:39:09 PDT 2024
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6e391325af849df1efe45cf13d284a1b0da0ab74
commit 6e391325af849df1efe45cf13d284a1b0da0ab74
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Apr 4 12:54:25 2024 +0200
hostapd: remove workaround for broken WPA IEs in ancient devices
Affected devices were already quite old when this patch was added.
Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
.../patches/390-wpa_ie_cap_workaround.patch | 61 ----------------------
1 file changed, 61 deletions(-)
diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
deleted file mode 100644
index fc26a84468..0000000000
--- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Felix Fietkau <nbd at openwrt.org>
-Date: Sun, 4 Sep 2011 18:23:36 +0000
-Subject: [PATCH] hostapd: add a workaround for driver issues in various
- android devices with texas instruments wifi
-
---- a/src/common/wpa_common.c
-+++ b/src/common/wpa_common.c
-@@ -2856,6 +2856,31 @@ u32 wpa_akm_to_suite(int akm)
- }
-
-
-+static void wpa_fixup_wpa_ie_rsn(u8 *assoc_ie, const u8 *wpa_msg_ie,
-+ size_t rsn_ie_len)
-+{
-+ int pos, count;
-+
-+ pos = sizeof(struct rsn_ie_hdr) + RSN_SELECTOR_LEN;
-+ if (rsn_ie_len < pos + 2)
-+ return;
-+
-+ count = WPA_GET_LE16(wpa_msg_ie + pos);
-+ pos += 2 + count * RSN_SELECTOR_LEN;
-+ if (rsn_ie_len < pos + 2)
-+ return;
-+
-+ count = WPA_GET_LE16(wpa_msg_ie + pos);
-+ pos += 2 + count * RSN_SELECTOR_LEN;
-+ if (rsn_ie_len < pos + 2)
-+ return;
-+
-+ if (!assoc_ie[pos] && !assoc_ie[pos + 1] &&
-+ (wpa_msg_ie[pos] || wpa_msg_ie[pos + 1]))
-+ memcpy(&assoc_ie[pos], &wpa_msg_ie[pos], 2);
-+}
-+
-+
- int wpa_compare_rsn_ie(int ft_initial_assoc,
- const u8 *ie1, size_t ie1len,
- const u8 *ie2, size_t ie2len)
-@@ -2863,8 +2888,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
- if (ie1 == NULL || ie2 == NULL)
- return -1;
-
-- if (ie1len == ie2len && os_memcmp(ie1, ie2, ie1len) == 0)
-- return 0; /* identical IEs */
-+ if (ie1len == ie2len) {
-+ u8 *ie_tmp;
-+
-+ if (os_memcmp(ie1, ie2, ie1len) == 0)
-+ return 0; /* identical IEs */
-+
-+ ie_tmp = alloca(ie1len);
-+ memcpy(ie_tmp, ie1, ie1len);
-+ wpa_fixup_wpa_ie_rsn(ie_tmp, ie2, ie1len);
-+
-+ if (os_memcmp(ie_tmp, ie2, ie1len) == 0)
-+ return 0; /* only mismatch in RSN capabilties */
-+ }
-
- #ifdef CONFIG_IEEE80211R
- if (ft_initial_assoc) {
More information about the lede-commits
mailing list