From 361afb4f0f45668114cb423b8aeb8344c24d8b89 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 23 Feb 2017 17:59:13 +0200 Subject: [PATCH] tests: FILS SK using ERP with SIM Signed-off-by: Jouni Malinen --- tests/hwsim/test_erp.py | 4 ++-- tests/hwsim/test_fils.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_erp.py b/tests/hwsim/test_erp.py index 82741955a..c19dffae5 100644 --- a/tests/hwsim/test_erp.py +++ b/tests/hwsim/test_erp.py @@ -107,7 +107,7 @@ def test_erp_server_no_match(dev, apdev): raise Exception("Unexpected use of ERP") dev[0].wait_connected(timeout=15, error="Reconnection timed out") -def start_erp_as(apdev): +def start_erp_as(apdev, erp_domain="example.com"): params = { "ssid": "as", "beacon_int": "2000", "radius_server_clients": "auth_serv/radius_clients.conf", "radius_server_auth_port": '18128', @@ -122,7 +122,7 @@ def start_erp_as(apdev): "eap_fast_a_id": "101112131415161718191a1b1c1d1e1f", "eap_fast_a_id_info": "test server", "eap_server_erp": "1", - "erp_domain": "example.com" } + "erp_domain": erp_domain } return hostapd.add_ap(apdev, params) def test_erp_radius(dev, apdev): diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py index 748b3a193..62f5f969e 100644 --- a/tests/hwsim/test_fils.py +++ b/tests/hwsim/test_fils.py @@ -1212,3 +1212,41 @@ def test_fils_sk_erp_and_reauth(dev, apdev): raise Exception("Unexpected EAP exchange") if "EVENT-ASSOC-REJECT" in ev: raise Exception("Association failed") + +def test_fils_sk_erp_sim(dev, apdev): + """FILS SK using ERP with SIM""" + check_fils_capa(dev[0]) + check_erp_capa(dev[0]) + + realm='wlan.mnc001.mcc232.3gppnetwork.org' + start_erp_as(apdev[1], erp_domain=realm) + + bssid = apdev[0]['bssid'] + params = hostapd.wpa2_eap_params(ssid="fils") + params['wpa_key_mgmt'] = "FILS-SHA256" + params['auth_server_port'] = "18128" + params['fils_realm'] = realm + 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="SIM", identity="1232010000000000@" + realm, + password="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581", + erp="1", scan_freq="2412") + + hapd.disable() + dev[0].wait_disconnected() + dev[0].dump_monitor() + hapd.enable() + + ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED", + "EVENT-ASSOC-REJECT", + "CTRL-EVENT-CONNECTED"], timeout=10) + if ev is None: + raise Exception("Reconnection using FILS/ERP timed out") + if "CTRL-EVENT-EAP-STARTED" in ev: + raise Exception("Unexpected EAP exchange") + if "EVENT-ASSOC-REJECT" in ev: + raise Exception("Association failed")