From 995ee4c94bc52eb13675b04b87474d3eb135c4d8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 22 Jan 2021 17:08:48 +0200 Subject: [PATCH] tests: DPP Responder behavior on missing Auth Confirm Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 5a9d1eeae..2b22171d3 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -2821,6 +2821,7 @@ def run_dpp_proto_init(dev, test_dev, test, mutual=False, unicast=True, own = id1b dev[1].dpp_auth_init(uri=uri0, role=role, configurator=configurator, conf=conf, own=own) + return uri0, role, configurator, conf, own def test_dpp_proto_after_wrapped_data_auth_req(dev, apdev): """DPP protocol testing - attribute after Wrapped Data in Auth Req""" @@ -3249,7 +3250,7 @@ def test_dpp_proto_stop_at_auth_req(dev, apdev): def test_dpp_proto_stop_at_auth_resp(dev, apdev): """DPP protocol testing - stop when receiving Auth Resp""" - run_dpp_proto_init(dev, 1, 88) + uri0, role, configurator, conf, own = run_dpp_proto_init(dev, 1, 88) ev = dev[1].wait_event(["DPP-TX "], timeout=5) if ev is None: @@ -3263,6 +3264,18 @@ def test_dpp_proto_stop_at_auth_resp(dev, apdev): if ev is not None: raise Exception("Unexpected Auth Conf TX") + ev = dev[0].wait_event(["DPP-FAIL"], timeout=2) + if ev is None or "No Auth Confirm received" not in ev: + raise Exception("DPP-FAIL for missing Auth Confirm not reported") + time.sleep(0.1) + + # Try again without special testing behavior to confirm Responder is able + # to accept a new provisioning attempt. + dev[1].set("dpp_test", "0") + dev[1].dpp_auth_init(uri=uri0, role=role, configurator=configurator, + conf=conf, own=own) + wait_auth_success(dev[0], dev[1]) + def test_dpp_proto_stop_at_auth_conf(dev, apdev): """DPP protocol testing - stop when receiving Auth Conf""" run_dpp_proto_init(dev, 0, 89, init_enrollee=True)