From 133439b89ac7239f81d83220feaa0da023b306ff Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 12 Mar 2017 23:04:24 +0200 Subject: [PATCH] tests: FILS SK authentication type mismatch (PFS not supported) Signed-off-by: Jouni Malinen --- tests/hwsim/test_fils.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py index eb8b35fd0..fd76a5205 100644 --- a/tests/hwsim/test_fils.py +++ b/tests/hwsim/test_fils.py @@ -1366,3 +1366,41 @@ def test_fils_sk_pfs_group_mismatch(dev, apdev): raise Exception("Authentication rejection not seen") if "auth_type=5 auth_transaction=2 status_code=77" not in ev: raise Exception("Unexpected auth reject value: " + ev) + +def test_fils_sk_auth_mismatch(dev, apdev): + """FILS SK authentication type mismatch (PFS not supported)""" + check_fils_capa(dev[0]) + check_erp_capa(dev[0]) + + start_erp_as(apdev[1]) + + bssid = apdev[0]['bssid'] + params = hostapd.wpa2_eap_params(ssid="fils") + params['wpa_key_mgmt'] = "FILS-SHA256" + params['auth_server_port'] = "18128" + params['erp_domain'] = 'example.com' + params['fils_realm'] = 'example.com' + params['disable_pmksa_caching'] = '1' + hapd = hostapd.add_ap(apdev[0]['ifname'], params) + + dev[0].scan_for_bss(bssid, freq=2412) + dev[0].request("ERP_FLUSH") + id = dev[0].connect("fils", key_mgmt="FILS-SHA256", + eap="PSK", identity="psk.user@example.com", + password_hex="0123456789abcdef0123456789abcdef", + erp="1", fils_dh_group="19", scan_freq="2412") + + dev[0].request("DISCONNECT") + dev[0].wait_disconnected() + + dev[0].dump_monitor() + dev[0].select_network(id, freq=2412) + ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED", + "EVENT-ASSOC-REJECT", + "CTRL-EVENT-CONNECTED"], timeout=10) + if ev is None: + raise Exception("Connection using FILS/ERP timed out") + if "CTRL-EVENT-EAP-STARTED" not in ev: + raise Exception("No EAP exchange seen") + dev[0].wait_connected() + hwsim_utils.test_connectivity(dev[0], hapd)