aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-12-01 23:17:37 (GMT)
committerJouni Malinen <j@w1.fi>2017-12-02 10:00:44 (GMT)
commit41dafe0c0a8ccd204300210813ebd3a286022a8b (patch)
tree4ae0997091c10f41fe8907be3554a3420b403ccb
parent163fc3d562313ac6a349eae67f86fd30c10a4b9a (diff)
downloadhostap-41dafe0c0a8ccd204300210813ebd3a286022a8b.zip
hostap-41dafe0c0a8ccd204300210813ebd3a286022a8b.tar.gz
hostap-41dafe0c0a8ccd204300210813ebd3a286022a8b.tar.bz2
tests: DPP testing to check for mutual authentication on Initiator
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--tests/hwsim/test_dpp.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py
index 277d680..9fa3361 100644
--- a/tests/hwsim/test_dpp.py
+++ b/tests/hwsim/test_dpp.py
@@ -251,6 +251,13 @@ def test_dpp_qr_code_auth_mutual(dev, apdev):
raise Exception("Failed to start listen operation")
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
raise Exception("Failed to initiate DPP Authentication")
+
+ ev = dev[1].wait_event(["DPP-AUTH-DIRECTION"], timeout=5)
+ if ev is None:
+ raise Exception("DPP authentication direction not indicated (Initiator)")
+ if "mutual=1" not in ev:
+ raise Exception("Mutual authentication not used")
+
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
if ev is None:
raise Exception("DPP authentication did not succeed (Responder)")
@@ -304,6 +311,12 @@ def test_dpp_qr_code_auth_mutual2(dev, apdev):
raise Exception("Failed to parse QR Code URI")
id0b = int(res)
+ ev = dev[1].wait_event(["DPP-AUTH-DIRECTION"], timeout=5)
+ if ev is None:
+ raise Exception("DPP authentication direction not indicated (Initiator)")
+ if "mutual=1" not in ev:
+ raise Exception("Mutual authentication not used")
+
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
if ev is None:
raise Exception("DPP authentication did not succeed (Responder)")
@@ -375,6 +388,12 @@ def run_dpp_qr_code_auth_mutual(dev, apdev, curve):
if "FAIL" in res:
raise Exception("Failed to parse QR Code URI")
+ ev = dev[1].wait_event(["DPP-AUTH-DIRECTION"], timeout=5)
+ if ev is None:
+ raise Exception("DPP authentication direction not indicated (Initiator)")
+ if "mutual=1" not in ev:
+ raise Exception("Mutual authentication not used")
+
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
if ev is None:
raise Exception("DPP authentication did not succeed (Responder)")
@@ -484,6 +503,13 @@ def test_dpp_qr_code_auth_mutual_not_used(dev, apdev):
raise Exception("Failed to start listen operation")
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
raise Exception("Failed to initiate DPP Authentication")
+
+ ev = dev[1].wait_event(["DPP-AUTH-DIRECTION"], timeout=5)
+ if ev is None:
+ raise Exception("DPP authentication direction not indicated (Initiator)")
+ if "mutual=0" not in ev:
+ raise Exception("Mutual authentication not used")
+
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
if ev is None:
raise Exception("DPP authentication did not succeed (Responder)")