From 09a4404a33562e4c8dec2dc606f052997010bfaf Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 19 Dec 2015 20:59:14 +0200 Subject: [PATCH] tests: EAP-PEAP version forcing Signed-off-by: Jouni Malinen --- tests/hwsim/auth_serv/eap_user.conf | 2 ++ tests/hwsim/test_ap_eap.py | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/tests/hwsim/auth_serv/eap_user.conf b/tests/hwsim/auth_serv/eap_user.conf index da42f5b0f..fd7399ff6 100644 --- a/tests/hwsim/auth_serv/eap_user.conf +++ b/tests/hwsim/auth_serv/eap_user.conf @@ -58,6 +58,8 @@ radius_accept_attr=89:s:macacl-cui-test "0232010000000000@peap" PEAP,AKA "0232010000000000@fast" FAST,AKA "6555444333222111@both" AKA',AKA +"peap-ver0" PEAP [ver=0] +"peap-ver1" PEAP [ver=1] "0"* AKA "1"* SIM diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index ce5de5fe1..e0cce6b02 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -1372,6 +1372,33 @@ def test_ap_wpa2_eap_peap_params(dev, apdev): if ev is not None: raise Exception("Unexpected connection") + tests = [ ("peap-ver0", ""), + ("peap-ver1", ""), + ("peap-ver0", "peapver=0"), + ("peap-ver1", "peapver=1") ] + for anon,phase1 in tests: + dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="PEAP", + identity="user", anonymous_identity=anon, + password="password", phase1=phase1, + ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2", + scan_freq="2412") + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + + tests = [ ("peap-ver0", "peapver=1"), + ("peap-ver1", "peapver=0") ] + for anon,phase1 in tests: + dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="PEAP", + identity="user", anonymous_identity=anon, + password="password", phase1=phase1, + ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2", + wait_connect=False, scan_freq="2412") + ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"], timeout=15) + if ev is None: + raise Exception("No EAP-Failure seen") + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + def test_ap_wpa2_eap_peap_eap_tls(dev, apdev): """WPA2-Enterprise connection using EAP-PEAP/EAP-TLS""" params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")