tests: DPP testing to check for mutual authentication on Initiator
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
163fc3d562
commit
41dafe0c0a
1 changed files with 26 additions and 0 deletions
|
@ -251,6 +251,13 @@ def test_dpp_qr_code_auth_mutual(dev, apdev):
|
||||||
raise Exception("Failed to start listen operation")
|
raise Exception("Failed to start listen operation")
|
||||||
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
|
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
|
||||||
raise Exception("Failed to initiate DPP Authentication")
|
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)
|
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DPP authentication did not succeed (Responder)")
|
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")
|
raise Exception("Failed to parse QR Code URI")
|
||||||
id0b = int(res)
|
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)
|
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DPP authentication did not succeed (Responder)")
|
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:
|
if "FAIL" in res:
|
||||||
raise Exception("Failed to parse QR Code URI")
|
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)
|
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DPP authentication did not succeed (Responder)")
|
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")
|
raise Exception("Failed to start listen operation")
|
||||||
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
|
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
|
||||||
raise Exception("Failed to initiate DPP Authentication")
|
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)
|
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("DPP authentication did not succeed (Responder)")
|
raise Exception("DPP authentication did not succeed (Responder)")
|
||||||
|
|
Loading…
Reference in a new issue