From a0f350fd79cfc752e4ba638c1038888663a0f1d8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 30 Mar 2014 10:12:20 +0300 Subject: [PATCH] tests: EAP-SIM server using GSM triplets Signed-off-by: Jouni Malinen --- tests/hwsim/auth_serv/hlr_auc_gw.gsm | 17 +++++++++++++++++ tests/hwsim/start.sh | 2 +- tests/hwsim/test_ap_eap.py | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/hwsim/auth_serv/hlr_auc_gw.gsm diff --git a/tests/hwsim/auth_serv/hlr_auc_gw.gsm b/tests/hwsim/auth_serv/hlr_auc_gw.gsm new file mode 100644 index 000000000..b67aeca3d --- /dev/null +++ b/tests/hwsim/auth_serv/hlr_auc_gw.gsm @@ -0,0 +1,17 @@ +# Test triplets generated with GSM-Milenage using +# Ki = 90dca4eda45b53cf0f12d7c9c3bc6a89 +# OPc = cb9cccc4b9258e6dca4760379fb82581 + +# GSM authentication triplet file for EAP-SIM authenticator +# IMSI:Kc:SRES:RAND +# IMSI: ASCII string (numbers) +# Kc: hex, 8 octets +# SRES: hex, 4 octets +# RAND: hex, 16 octets + +232010000000001:79747302dd684291:fbe55c44:d29b2f51f1fd20304ad0c447b4dcdc37 +232010000000001:2f2eaa1d83e43813:6e2e3ea3:e19a8e96255b88e8a8be104637d165b2 +232010000000001:b7c935bfb51f2c5a:257581f5:8079c338eb4195d0fe2d46b357979054 +232010000000001:bc93df6af0412a69:dae1faa0:a48b8e2a59b8bed468ea3d57ef9ee118 +232010000000001:626db3b0e9e321c3:a3e33208:38e7e65d0c0ef82185d1697410f2b31a +232010000000001:df3cab53d00c622e:0b785f5d:d8a4a9efe1689d232468f316d2a84270 diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index 95d129082..cebbfad1d 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -83,7 +83,7 @@ if [ "x$VALGRIND" = "xy" ]; then fi if [ -x $HLR_AUC_GW ]; then - sudo $HLR_AUC_GW -m $DIR/auth_serv/hlr_auc_gw.milenage_db > $LOGDIR/hlr_auc_gw & + sudo $HLR_AUC_GW -m $DIR/auth_serv/hlr_auc_gw.milenage_db -g $DIR/auth_serv/hlr_auc_gw.gsm > $LOGDIR/hlr_auc_gw & fi sudo $HAPD_AS -ddKt $LOGDIR/as.conf > $LOGDIR/auth_serv & diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 19afa048b..df2fc1021 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -111,6 +111,12 @@ def test_ap_wpa2_eap_sim(dev, apdev): hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) eap_reauth(dev[0], "SIM") + eap_connect(dev[1], apdev[0], "SIM", "1232010000000001", + password="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581") + eap_connect(dev[2], apdev[0], "SIM", "1232010000000002", + password="90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581", + expect_failure=True) + logger.info("Negative test with incorrect key") dev[0].request("REMOVE_NETWORK all") eap_connect(dev[0], apdev[0], "SIM", "1232010000000000",