From 0cc6f985d17a59d953d009f3dd41471c270d64f6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 5 Sep 2022 21:56:08 +0300 Subject: [PATCH] wlantest: Recognize additional not-Robust Action categories Do not complain about unprotected Action frames for additional categories that have been defined as not being Robust. Signed-off-by: Jouni Malinen --- src/common/ieee802_11_defs.h | 12 ++++++++++-- wlantest/rx_mgmt.c | 30 ++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 65e125e83..82c982389 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -611,12 +611,20 @@ #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 */ diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index f8f961a4f..50c250726 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -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; }