tests: DPP testing to check for mutual authentication on Initiator

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-12-02 01:17:37 +02:00 committed by Jouni Malinen
parent 163fc3d562
commit 41dafe0c0a

View file

@ -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)")