From d12a3dce82a95b0fd7e4d0b160b8961964fca28f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 28 Aug 2023 12:16:42 +0300 Subject: [PATCH] wlantest: Store and check SNonce/ANonce for FT Authentication Store SNonce and ANonce from FT Authentication frames during FT over-the-air so that these values are available for processing the FT reassociation frames. Signed-off-by: Jouni Malinen --- wlantest/rx_mgmt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index 6f42cb5ca..d861281a5 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -537,12 +537,26 @@ static void process_ft_auth(struct wlantest *wt, struct wlantest_bss *bss, if (trans == 1) { sta->key_mgmt = parse.key_mgmt; sta->pairwise_cipher = parse.pairwise_cipher; + if (parse.fte_snonce) + os_memcpy(sta->snonce, parse.fte_snonce, WPA_NONCE_LEN); goto out; } if (trans != 2) goto out; + if (!parse.fte_snonce || + os_memcmp(sta->snonce, parse.fte_snonce, WPA_NONCE_LEN) != 0) { + add_note(wt, MSG_INFO, "FT: SNonce mismatch in FTE"); + wpa_hexdump(MSG_DEBUG, "FT: Received SNonce", + parse.fte_snonce, WPA_NONCE_LEN); + wpa_hexdump(MSG_DEBUG, "FT: Expected SNonce", + sta->snonce, WPA_NONCE_LEN); + } + + if (parse.fte_anonce) + os_memcpy(sta->anonce, parse.fte_anonce, WPA_NONCE_LEN); + /* TODO: Should find the latest updated PMK-R0 value here instead * copying the one from the first found matching old STA entry. */ dl_list_for_each(old_bss, &wt->bss, struct wlantest_bss, list) {