]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Recognize additional not-Robust Action categories
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 5 Sep 2022 18:56:08 +0000 (21:56 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 5 Sep 2022 19:06:31 +0000 (22:06 +0300)
Do not complain about unprotected Action frames for additional
categories that have been defined as not being Robust.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/common/ieee802_11_defs.h
wlantest/rx_mgmt.c

index 65e125e8352fe7ba0a2a57aaed761b7ee8a5b150..82c98238953645a30ed1749a679029b52486614b 100644 (file)
 #define WLAN_ACTION_ROBUST_AV_STREAMING 19
 #define WLAN_ACTION_UNPROTECTED_DMG 20
 #define WLAN_ACTION_VHT 21
-#define WLAN_ACTION_S1G 22
-#define WLAN_ACTION_S1G_RELAY 23
+#define WLAN_ACTION_UNPROTECTED_S1G 22
+#define WLAN_ACTION_S1G 23
 #define WLAN_ACTION_FLOW_CONTROL 24
 #define WLAN_ACTION_CTRL_RESP_MCS_NEG 25
 #define WLAN_ACTION_FILS 26
+#define WLAN_ACTION_CDMG 27
+#define WLAN_ACTION_CMMG 28
+#define WLAN_ACTION_GLK 29
+#define WLAN_ACTION_HE 30
+#define WLAN_ACTION_PROTECTED_HE 31
+#define WLAN_ACTION_WUR 32
 #define WLAN_ACTION_PROTECTED_FTM 34
+#define WLAN_ACTION_EHT 36
+#define WLAN_ACTION_PROTECTED_EHT 37
 #define WLAN_ACTION_VENDOR_SPECIFIC_PROTECTED 126
 #define WLAN_ACTION_VENDOR_SPECIFIC 127
 /* Note: 128-255 used to report errors by setting category | 0x80 */
index f8f961a4fd847a685a5a921f864e4aea54c33484..50c25072620863a71bde2429c261748465c865b7 100644 (file)
@@ -2443,20 +2443,37 @@ static u8 * mgmt_decrypt(struct wlantest *wt, const u8 *data, size_t len,
 }
 
 
+static bool is_robust_action_category(u8 category)
+{
+       return category != WLAN_ACTION_PUBLIC &&
+               category != WLAN_ACTION_HT &&
+               category != WLAN_ACTION_UNPROTECTED_WNM &&
+               category != WLAN_ACTION_SELF_PROTECTED &&
+               category != WLAN_ACTION_UNPROTECTED_DMG &&
+               category != WLAN_ACTION_VHT &&
+               category != WLAN_ACTION_UNPROTECTED_S1G &&
+               category != WLAN_ACTION_HE &&
+               category != WLAN_ACTION_EHT &&
+               category != WLAN_ACTION_VENDOR_SPECIFIC;
+}
+
+
 static int check_mgmt_ccmp_gcmp(struct wlantest *wt, const u8 *data, size_t len)
 {
        const struct ieee80211_mgmt *mgmt;
        u16 fc;
        struct wlantest_bss *bss;
        struct wlantest_sta *sta;
+       int category = -1;
 
        mgmt = (const struct ieee80211_mgmt *) data;
        fc = le_to_host16(mgmt->frame_control);
 
-       if (WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION ||
-           WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION_NO_ACK) {
-               if (len > 24 &&
-                   mgmt->u.action.category == WLAN_ACTION_PUBLIC)
+       if ((WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION ||
+            WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION_NO_ACK) &&
+           len > 24) {
+               category = mgmt->u.action.category;
+               if (!is_robust_action_category(category))
                        return 0; /* Not a robust management frame */
        }
 
@@ -2476,8 +2493,9 @@ static int check_mgmt_ccmp_gcmp(struct wlantest *wt, const u8 *data, size_t len)
             WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION ||
             WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION_NO_ACK)) {
                add_note(wt, MSG_INFO,
-                        "Robust individually-addressed management frame sent without CCMP/GCMP by "
-                        MACSTR, MAC2STR(mgmt->sa));
+                        "Robust individually-addressed management frame (stype=%u category=%d) sent without CCMP/GCMP by "
+                        MACSTR, WLAN_FC_GET_STYPE(fc), category,
+                        MAC2STR(mgmt->sa));
                return -1;
        }