]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Extend protected Data frame checks for GCMP and CCMP-256
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 29 Aug 2022 18:31:52 +0000 (21:31 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 29 Aug 2022 18:31:52 +0000 (21:31 +0300)
The same rules that apply to CCMP-128 apply also for GCMP-128, CCMP-256,
and GCMP-256 here.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wlantest/rx_data.c

index 16e0f53bc22f3f0493680c7fbd3e7e5af529cad8..14220f2736eee005ffbf053d83878ceb7b9df2fc 100644 (file)
@@ -507,9 +507,11 @@ static void rx_data_bss_prot(struct wlantest *wt,
 
        if (sta == NULL)
                return;
-       if (sta->pairwise_cipher & (WPA_CIPHER_TKIP | WPA_CIPHER_CCMP) &&
+       if (sta->pairwise_cipher & (WPA_CIPHER_TKIP | WPA_CIPHER_CCMP |
+                                   WPA_CIPHER_GCMP | WPA_CIPHER_GCMP_256 |
+                                   WPA_CIPHER_CCMP_256) &&
            !(data[3] & 0x20)) {
-               add_note(wt, MSG_INFO, "Expected TKIP/CCMP frame from "
+               add_note(wt, MSG_INFO, "Expected TKIP/CCMP/GCMP frame from "
                         MACSTR " did not have ExtIV bit set to 1",
                         MAC2STR(src));
                return;
@@ -528,9 +530,12 @@ static void rx_data_bss_prot(struct wlantest *wt,
                                 MAC2STR(hdr->addr2), data[1],
                                 (data[0] | 0x20) & 0x7f);
                }
-       } else if (tk || sta->pairwise_cipher == WPA_CIPHER_CCMP) {
+       } else if (tk || sta->pairwise_cipher == WPA_CIPHER_CCMP ||
+                  sta->pairwise_cipher == WPA_CIPHER_GCMP ||
+                  sta->pairwise_cipher == WPA_CIPHER_GCMP_256 ||
+                  sta->pairwise_cipher == WPA_CIPHER_CCMP_256) {
                if (data[2] != 0 || (data[3] & 0x1f) != 0) {
-                       add_note(wt, MSG_INFO, "CCMP frame from " MACSTR
+                       add_note(wt, MSG_INFO, "CCMP/GCMP frame from " MACSTR
                                 " used non-zero reserved bit",
                                 MAC2STR(hdr->addr2));
                }