From: Ainy Kumari Date: Sat, 4 Oct 2025 12:44:26 +0000 (+0530) Subject: tests: SAE-EXT-KEY AKM support for PASN authentication X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c465a1815e7513b4d4cc66ab8c767922bcc1b77;p=thirdparty%2Fhostap.git tests: SAE-EXT-KEY AKM support for PASN authentication Add a test case for PASN authentication with SAE-EXT-KEY AKM, verifying PMK derivation, PMKSA caching, and failure with incorrect passphrase. Signed-off-by: Ainy Kumari --- diff --git a/tests/hwsim/test_pasn.py b/tests/hwsim/test_pasn.py index 07d42c038..c64e5b566 100644 --- a/tests/hwsim/test_pasn.py +++ b/tests/hwsim/test_pasn.py @@ -490,6 +490,38 @@ def test_pasn_sae(dev, apdev): finally: dev[0].set("sae_pwe", "0") +@remote_compatible +def test_pasn_sae_ext_key(dev, apdev): + """PASN authentication with SAE-EXT-KEY AP with PMK derivation + PMKSA caching""" + check_pasn_capab(dev[0]) + check_sae_capab(dev[0]) + + params = hostapd.wpa2_params(ssid="test-pasn-sae", + passphrase="12345678") + params['wpa_key_mgmt'] = 'SAE SAE-EXT-KEY PASN' + params['sae_pwe'] = "2" + hapd = start_pasn_ap(apdev[0], params) + + try: + dev[0].set("sae_pwe", "2") + dev[0].connect("test-pasn-sae", psk="12345678", key_mgmt="SAE-EXT-KEY", + scan_freq="2412", only_add_network=True) + + # first test with a valid PSK + check_pasn_akmp_cipher(dev[0], hapd, "SAE-EXT-KEY", "CCMP", nid="0") + + # And now with PMKSA caching + check_pasn_akmp_cipher(dev[0], hapd, "SAE-EXT-KEY", "CCMP") + + # And now with a wrong passphrase + if "FAIL" in dev[0].request("PMKSA_FLUSH"): + raise Exception("PMKSA_FLUSH failed") + + dev[0].set_network_quoted(0, "psk", "12345678787") + check_pasn_akmp_cipher(dev[0], hapd, "SAE-EXT-KEY", "CCMP", status=1, nid="0") + finally: + dev[0].set("sae_pwe", "0") + @remote_compatible def test_pasn_sae_while_connected_same_channel(dev, apdev): """PASN SAE authentication while connected same channel"""