1 --- a/src/common/wpa_common.c
2 +++ b/src/common/wpa_common.c
3 @@ -959,6 +959,31 @@ const char * wpa_key_mgmt_txt(int key_mg
7 +static void wpa_fixup_wpa_ie_rsn(u8 *assoc_ie, const u8 *wpa_msg_ie,
12 + pos = sizeof(struct rsn_ie_hdr) + RSN_SELECTOR_LEN;
13 + if (rsn_ie_len < pos + 2)
16 + count = WPA_GET_LE16(wpa_msg_ie + pos);
17 + pos += 2 + count * RSN_SELECTOR_LEN;
18 + if (rsn_ie_len < pos + 2)
21 + count = WPA_GET_LE16(wpa_msg_ie + pos);
22 + pos += 2 + count * RSN_SELECTOR_LEN;
23 + if (rsn_ie_len < pos + 2)
26 + if (!assoc_ie[pos] && !assoc_ie[pos + 1] &&
27 + (wpa_msg_ie[pos] || wpa_msg_ie[pos + 1]))
28 + memcpy(&assoc_ie[pos], &wpa_msg_ie[pos], 2);
32 int wpa_compare_rsn_ie(int ft_initial_assoc,
33 const u8 *ie1, size_t ie1len,
34 const u8 *ie2, size_t ie2len)
35 @@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
36 if (ie1 == NULL || ie2 == NULL)
39 - if (ie1len == ie2len && os_memcmp(ie1, ie2, ie1len) == 0)
40 - return 0; /* identical IEs */
41 + if (ie1len == ie2len) {
44 + if (os_memcmp(ie1, ie2, ie1len) == 0)
45 + return 0; /* identical IEs */
47 + ie_tmp = alloca(ie1len);
48 + memcpy(ie_tmp, ie1, ie1len);
49 + wpa_fixup_wpa_ie_rsn(ie_tmp, ie2, ie1len);
51 + if (os_memcmp(ie_tmp, ie2, ie1len) == 0)
52 + return 0; /* only mismatch in RSN capabilties */
55 #ifdef CONFIG_IEEE80211R
56 if (ft_initial_assoc) {