]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: scan: print RSN Element Override IEs
authorAlex Gavin <a_gavin@icloud.com>
Mon, 16 Mar 2026 05:16:46 +0000 (22:16 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 16 Mar 2026 10:27:45 +0000 (11:27 +0100)
Parse body of RSN Element Override IEs as RSN IEs
using existing code.

RSN IEs are a minimum size of 4 octets, as detailed
in IEEE802.11-2024, 9.4.2.23.1

Example output:
RSN Element Override:
 * Version: 1
 * Group cipher: CCMP
 * Pairwise ciphers: CCMP
 * Authentication suites: SAE
 * Capabilities: 16-PTKSA-RC 1-GTKSA-RC MFP-required MFP-capable (0x00cc)
RSN Element Override 2:
 * Version: 1
 * Group cipher: CCMP
 * Pairwise ciphers: GCMP-256
 * Authentication suites: SAE-EXT-KEY
 * Capabilities: 16-PTKSA-RC 1-GTKSA-RC MFP-required MFP-capable (0x00cc)

Signed-off-by: Alex Gavin <a_gavin@icloud.com>
Link: https://patch.msgid.link/20260316051646.18303-2-a_gavin@icloud.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
scan.c

diff --git a/scan.c b/scan.c
index 4d3284e82535d8332d0b5afa9c831623f135ba09..2b6e9043bd02f366afa0b8aa079876da0436a5a0 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -1893,6 +1893,14 @@ static void print_wifi_osen(const uint8_t type, uint8_t len,
        print_osen_ie("OSEN", "OSEN", len, data);
 }
 
+static void print_wifi_rsn_override(const uint8_t type, uint8_t len,
+                           const uint8_t *data,
+                           const struct ie_context *ctx)
+{
+       printf("\n\t");
+       print_rsn_ie("CCMP", "IEEE802.1X", len, data);
+}
+
 static bool print_wifi_wmm_param(const uint8_t *data, uint8_t len)
 {
        int i;
@@ -2344,6 +2352,8 @@ static const struct ie_print wfa_printers[] = {
        [16] = { "HotSpot 2.0 Indication", print_hs20_ind, 1, 255, BIT(PRINT_SCAN), },
        [18] = { "HotSpot 2.0 OSEN", print_wifi_osen, 1, 255, BIT(PRINT_SCAN), },
        [28] = { "OWE Transition Mode", print_wifi_owe_trans, 7, 255, BIT(PRINT_SCAN), },
+       [41] = { "RSN Element Override", print_wifi_rsn_override, 4, 255, BIT(PRINT_SCAN), },
+       [42] = { "RSN Element Override 2", print_wifi_rsn_override, 4, 255, BIT(PRINT_SCAN), },
 };
 
 static void print_vendor(unsigned char len, unsigned char *data,