]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Indicate if a TKIP/CCMP replay has Retry=1
authorAshok Kumar Ponnaiah <aponnaia@qti.qualcomm.com>
Fri, 29 Aug 2014 13:04:08 +0000 (16:04 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 3 Sep 2014 12:41:35 +0000 (15:41 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wlantest/rx_data.c
wlantest/rx_mgmt.c

index dec5857ea30785698a2dc4e5e4f9fa3134d51a53..e0c922904811adb9a77ac3f3752c417ba812848b 100644 (file)
@@ -192,11 +192,13 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
        if (os_memcmp(pn, bss->rsc[keyid], 6) <= 0) {
                u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
                add_note(wt, MSG_INFO, "CCMP/TKIP replay detected: A1=" MACSTR
-                        " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u",
+                        " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u%s",
                         MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                         MAC2STR(hdr->addr3),
                         WLAN_GET_SEQ_SEQ(seq_ctrl),
-                        WLAN_GET_SEQ_FRAG(seq_ctrl));
+                        WLAN_GET_SEQ_FRAG(seq_ctrl),
+                        (le_to_host16(hdr->frame_control) & WLAN_FC_RETRY) ?
+                        " Retry" : "");
                wpa_hexdump(MSG_INFO, "RX PN", pn, 6);
                wpa_hexdump(MSG_INFO, "RSC", bss->rsc[keyid], 6);
        }
@@ -369,11 +371,13 @@ static void rx_data_bss_prot(struct wlantest *wt,
        if (os_memcmp(pn, rsc, 6) <= 0) {
                u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
                add_note(wt, MSG_INFO, "CCMP/TKIP replay detected: A1=" MACSTR
-                        " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u",
+                        " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u%s",
                         MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                         MAC2STR(hdr->addr3),
                         WLAN_GET_SEQ_SEQ(seq_ctrl),
-                        WLAN_GET_SEQ_FRAG(seq_ctrl));
+                        WLAN_GET_SEQ_FRAG(seq_ctrl),
+                        (le_to_host16(hdr->frame_control) &  WLAN_FC_RETRY) ?
+                        " Retry" : "");
                wpa_hexdump(MSG_INFO, "RX PN", pn, 6);
                wpa_hexdump(MSG_INFO, "RSC", rsc, 6);
        }
index c6ff718ac2fd68b73d35e58d63de523d4f222819..367a6b5f767b71090074fd8655257f8b9cb13f5e 100644 (file)
@@ -930,11 +930,13 @@ static u8 * mgmt_ccmp_decrypt(struct wlantest *wt, const u8 *data, size_t len,
        if (os_memcmp(pn, rsc, 6) <= 0) {
                u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
                add_note(wt, MSG_INFO, "CCMP/TKIP replay detected: A1=" MACSTR
-                        " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u",
+                        " A2=" MACSTR " A3=" MACSTR " seq=%u frag=%u%s",
                         MAC2STR(hdr->addr1), MAC2STR(hdr->addr2),
                         MAC2STR(hdr->addr3),
                         WLAN_GET_SEQ_SEQ(seq_ctrl),
-                        WLAN_GET_SEQ_FRAG(seq_ctrl));
+                        WLAN_GET_SEQ_FRAG(seq_ctrl),
+                        (le_to_host16(hdr->frame_control) & WLAN_FC_RETRY) ?
+                        " Retry" : "");
                wpa_hexdump(MSG_INFO, "RX PN", pn, 6);
                wpa_hexdump(MSG_INFO, "RSC", rsc, 6);
        }