aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-05-25 10:42:08 (GMT)
committerJouni Malinen <j@w1.fi>2020-05-25 10:42:08 (GMT)
commit6e47dd04ff28665a8c466bc4ac99036a0b96ddae (patch)
tree2cf32b71a0b87c8d79731046ee3d81f1ecbd0e88 /wlantest
parentb6a3bcffd76b598ae44299f0a5860b9b82f2d99f (diff)
downloadhostap-6e47dd04ff28665a8c466bc4ac99036a0b96ddae.zip
hostap-6e47dd04ff28665a8c466bc4ac99036a0b96ddae.tar.gz
hostap-6e47dd04ff28665a8c466bc4ac99036a0b96ddae.tar.bz2
wlantest: Fix RSNE check in FT 4-way handshake msg 3/4
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_eapol.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/wlantest/rx_eapol.c b/wlantest/rx_eapol.c
index 4dff7f8..d75ed92 100644
--- a/wlantest/rx_eapol.c
+++ b/wlantest/rx_eapol.c
@@ -628,6 +628,7 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
const u8 *decrypted;
size_t decrypted_len = 0;
struct wpa_eapol_ie_parse ie;
+ struct wpa_ie_data rsn;
wpa_printf(MSG_DEBUG, "EAPOL-Key 3/4 " MACSTR " -> " MACSTR,
MAC2STR(src), MAC2STR(dst));
@@ -781,7 +782,9 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
}
if ((ie.rsn_ie &&
- os_memcmp(ie.rsn_ie, bss->rsnie, ie.rsn_ie_len) != 0) ||
+ wpa_compare_rsn_ie(wpa_key_mgmt_ft(sta->key_mgmt),
+ ie.rsn_ie, ie.rsn_ie_len,
+ bss->rsnie, 2 + bss->rsnie[1])) ||
(ie.rsn_ie == NULL && bss->rsnie[0])) {
add_note(wt, MSG_INFO, "Mismatch in RSN IE between EAPOL-Key "
"3/4 and Beacon/Probe Response from " MACSTR,
@@ -793,6 +796,16 @@ static void rx_data_eapol_key_3_of_4(struct wlantest *wt, const u8 *dst,
bss->rsnie[0] ? 2 + bss->rsnie[1] : 0);
}
+ if (wpa_key_mgmt_ft(sta->key_mgmt) &&
+ (wpa_parse_wpa_ie_rsn(ie.rsn_ie, ie.rsn_ie_len, &rsn) < 0 ||
+ rsn.num_pmkid != 1 || !rsn.pmkid ||
+ os_memcmp_const(rsn.pmkid, sta->pmk_r1_name,
+ WPA_PMK_NAME_LEN) != 0))
+ add_note(wt, MSG_INFO,
+ "FT: No matching PMKR1Name in FT 4-way handshake message 3/4");
+
+ /* TODO: validate MDE and FTE match */
+
learn_kde_keys(wt, bss, sta, decrypted, decrypted_len, hdr->key_rsc);
os_free(decrypted_buf);
}