From 4d38285b3bb36638a4cabfb0f43b24ab18657375 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 30 Nov 2018 14:21:35 +0200 Subject: [PATCH] tests: DPP protocol testing - Auth Conf RX processing failure Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 6c0d64b89..1928c2fb0 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -4113,6 +4113,26 @@ def test_dpp_proto_auth_resp_r_auth_mismatch(dev, apdev): if "Peer reported authentication failure" not in ev: raise Exception("Unexpected failure: " + ev) +def test_dpp_proto_auth_resp_r_auth_mismatch_failure(dev, apdev): + """DPP protocol testing - Auth Conf RX processing failure""" + with alloc_fail(dev[0], 1, "dpp_auth_conf_rx_failure"): + run_dpp_proto_init(dev, 0, 32, mutual=True) + ev = dev[0].wait_event(["DPP-FAIL"], timeout=5) + if ev is None: + raise Exception("DPP failure not seen") + if "Authentication failed" not in ev: + raise Exception("Unexpected failure: " + ev) + +def test_dpp_proto_auth_resp_r_auth_mismatch_failure2(dev, apdev): + """DPP protocol testing - Auth Conf RX processing failure 2""" + with fail_test(dev[0], 1, "dpp_auth_conf_rx_failure"): + run_dpp_proto_init(dev, 0, 32, mutual=True) + ev = dev[0].wait_event(["DPP-FAIL"], timeout=5) + if ev is None: + raise Exception("DPP failure not seen") + if "AES-SIV decryption failed" not in ev: + raise Exception("Unexpected failure: " + ev) + def run_dpp_proto_auth_conf_missing(dev, test, reason): run_dpp_proto_init(dev, 1, test, mutual=True) if reason is None: