]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Store and check SNonce/ANonce for FT Authentication
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 28 Aug 2023 09:16:42 +0000 (12:16 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 28 Aug 2023 10:25:07 +0000 (13:25 +0300)
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 <quic_jouni@quicinc.com>
wlantest/rx_mgmt.c

index 6f42cb5cab5067e8ad6fbfb4cb8f8258477e8053..d861281a5add4f353ac23425a62bdaaac10fa4da 100644 (file)
@@ -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) {