]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix pasn_sae_driver to clear PTKSA cache after first PASN exchange
authorPeddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
Fri, 13 Jun 2025 16:38:14 +0000 (22:08 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 19 Jun 2025 15:14:53 +0000 (18:14 +0300)
The test pasn_sae_driver triggers PASN for the same peers twice. In the
current implementation, when PASN succeeds, the keys generated are
stored in the PTKSA cache.

The function wpas_pasn_configure_next_peer() shows an issue where it
does not reuse keys from a previous PASN exchange, even when those keys
are available in the cache. Instead, it initiates a new PASN exchange
unnecessarily.

Fix the test case by deleting the keys from the cache after the first
PASN attempt. This ensures a full PASN exchange can occur again. A
subsequent commit will address the API behavior to reuse keys from the
cache when available.

Signed-off-by: Peddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
tests/hwsim/test_pasn.py

index 5a2ec578b6b8ba80da997f676607fbffe304726f..da671937376b85a3e3140b2efcc35d4d65a9b56f 100644 (file)
@@ -1068,6 +1068,10 @@ def test_pasn_sae_driver(dev, apdev):
         time.sleep(1)
         dev[0].dump_monitor()
 
+        cmd2 = f"PASN_DRIVER del {bssid} {bssid2}"
+        if "OK" not in dev[0].request(cmd2):
+            raise Exception("PASN_DRIVER failed")
+
         if "OK" not in dev[0].request(cmd):
             raise Exception("PASN_DRIVER failed")