From 7afa678033510d31e35f9ac84ece5744d6912ad9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 31 Jan 2015 13:35:31 +0200 Subject: [PATCH] tests: RSN pre-authentication timeout Signed-off-by: Jouni Malinen --- tests/hwsim/test_pmksa_cache.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py index c55c86d5a..ae6c30c5b 100644 --- a/tests/hwsim/test_pmksa_cache.py +++ b/tests/hwsim/test_pmksa_cache.py @@ -651,3 +651,25 @@ def _test_pmksa_cache_size_limit(dev, apdev): hapd = hostapd.HostapdGlobal() hapd.flush() hapd.remove(apdev[0]['ifname']) + +def test_pmksa_cache_preauth_timeout(dev, apdev): + """RSN pre-authentication timing out""" + try: + _test_pmksa_cache_preauth_timeout(dev, apdev) + finally: + dev[0].request("SET dot11RSNAConfigSATimeout 60") + +def _test_pmksa_cache_preauth_timeout(dev, apdev): + dev[0].request("SET dot11RSNAConfigSATimeout 1") + params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") + hostapd.add_ap(apdev[0]['ifname'], params) + eap_connect(dev[0], apdev[0], "PAX", "pax.user@example.com", + password_hex="0123456789abcdef0123456789abcdef", + bssid=apdev[0]['bssid']) + if "OK" not in dev[0].request("PREAUTH f2:11:22:33:44:55"): + raise Exception("PREAUTH failed") + ev = dev[0].wait_event(["RSN: pre-authentication with"], timeout=5) + if ev is None: + raise Exception("No timeout event seen") + if "timed out" not in ev: + raise Exception("Unexpected event: " + ev)