]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: AP MLD and RSN overriding with too long elements
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 23 Aug 2024 15:42:55 +0000 (18:42 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 23 Aug 2024 15:42:55 +0000 (18:42 +0300)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_rsn_override.py

index d0a2d30af8a4f458076813ed3c3a187b81938c50..721da51e22ed3621b86b1a61684ba8d76a779c81 100644 (file)
@@ -126,7 +126,12 @@ def test_rsn_override_mld_only_sta(dev, apdev):
     """AP MLD and RSN overriding only on STA"""
     run_rsn_override_mld(dev, apdev, False, only_sta=True)
 
-def run_rsn_override_mld(dev, apdev, mixed, only_sta=False):
+def test_rsn_override_mld_too_long_elems(dev, apdev):
+    """AP MLD and RSN overriding with too long elements"""
+    run_rsn_override_mld(dev, apdev, False, too_long_elems=True)
+
+def run_rsn_override_mld(dev, apdev, mixed, only_sta=False,
+                         too_long_elems=False):
     with HWSimRadio(use_mlo=True) as (hapd_radio, hapd_iface), \
         HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
 
@@ -174,13 +179,31 @@ def run_rsn_override_mld(dev, apdev, mixed, only_sta=False):
         hapd0 = eht_mld_enable_ap(hapd_iface, params)
 
         params1['channel'] = '6'
+        if too_long_elems:
+            params1['rsnoe_override'] = 'ddff506f9a29' + 251*'cc'
         hapd1 = eht_mld_enable_ap(hapd_iface, params1)
 
         wpas.set("sae_pwe", "1")
         wpas.set("rsn_overriding", "1")
         wpas.connect(ssid, sae_password=passphrase, scan_freq="2412 2437",
                      key_mgmt="SAE-EXT-KEY", ieee80211w="2", beacon_prot="1",
-                     pairwise="GCMP-256 CCMP")
+                     pairwise="GCMP-256 CCMP", wait_connect=not too_long_elems)
+        if too_long_elems:
+            ev = wpas.wait_event(['Associated with'], timeout=10)
+            if ev is None:
+                raise Exception("Association not reported")
+            ev = wpas.wait_event(['EAPOL-RX'], timeout=1)
+            if ev is None:
+                raise Exception("EAPOL-Key M1 not reported")
+            ev = wpas.wait_event(['EAPOL-RX', 'CTRL-EVENT-DISCONNECTED'],
+                                 timeout=10)
+            if ev is None:
+                raise Exception("Disconnection not reported")
+            # The AP is expected to fail to send M3 due to RSNOE/RSNO2E/RSNXOE
+            # being too long to fit into the RSN Override Link KDE.
+            if 'EAPOL-RX' in ev:
+                raise Exception("Unexpected EAPOL-Key M3 reported")
+            return
 
         eht_verify_status(wpas, hapd0, 2412, 20, is_ht=True, mld=True,
                           valid_links=3, active_links=3)