]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Add more details for replay debug messages
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 7 Jan 2011 12:17:08 +0000 (14:17 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 7 Jan 2011 12:17:08 +0000 (14:17 +0200)
These make it easier to find the frame in question when looking at
the capture in Wireshark.

wlantest/rx_data.c
wlantest/rx_mgmt.c

index 0d74b089fa24c7df54d8ca2faf5292621bb380de..fc264acb8555da72005025d7a1603b6ff19bab8b 100644 (file)
@@ -156,8 +156,13 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
        else
                ccmp_get_pn(pn, data);
        if (os_memcmp(pn, bss->rsc[keyid], 6) <= 0) {
-               wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: SA=" MACSTR,
-                          MAC2STR(hdr->addr2));
+               u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
+               wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: A1=" MACSTR
+                          " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u",
+                          MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
+                          MAC2STR(hdr->addr3),
+                          WLAN_GET_SEQ_SEQ(seq_ctrl),
+                          WLAN_GET_SEQ_FRAG(seq_ctrl));
                wpa_hexdump(MSG_INFO, "RX PN", pn, 6);
                wpa_hexdump(MSG_INFO, "RSC", bss->rsc[keyid], 6);
        }
@@ -296,8 +301,13 @@ static void rx_data_bss_prot(struct wlantest *wt,
        else
                ccmp_get_pn(pn, data);
        if (os_memcmp(pn, rsc, 6) <= 0) {
-               wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: SA=" MACSTR,
-                          MAC2STR(hdr->addr2));
+               u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
+               wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: A1=" MACSTR
+                          " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u",
+                          MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
+                          MAC2STR(hdr->addr3),
+                          WLAN_GET_SEQ_SEQ(seq_ctrl),
+                          WLAN_GET_SEQ_FRAG(seq_ctrl));
                wpa_hexdump(MSG_INFO, "RX PN", pn, 6);
                wpa_hexdump(MSG_INFO, "RSC", rsc, 6);
        }
index 8941129da9a9cd7d5ebf267aba6f739c99c6e28a..234de6103bf58d0703b1301772aca9c79bb8e030 100644 (file)
@@ -881,8 +881,13 @@ static u8 * mgmt_ccmp_decrypt(struct wlantest *wt, const u8 *data, size_t len,
 
        ccmp_get_pn(pn, data + 24);
        if (os_memcmp(pn, rsc, 6) <= 0) {
-               wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: SA=" MACSTR,
-                          MAC2STR(hdr->addr2));
+               u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
+               wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: A1=" MACSTR
+                          " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u",
+                          MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
+                          MAC2STR(hdr->addr3),
+                          WLAN_GET_SEQ_SEQ(seq_ctrl),
+                          WLAN_GET_SEQ_FRAG(seq_ctrl));
                wpa_hexdump(MSG_INFO, "RX PN", pn, 6);
                wpa_hexdump(MSG_INFO, "RSC", rsc, 6);
        }