From e9bca5b8c391f0b07709bc91fa47cc9a381c5cde Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 27 Nov 2018 16:39:21 +0200 Subject: [PATCH] tests: DPP QR Code and unsupported curve Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 10d402b88..0663ec717 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -158,6 +158,21 @@ def test_dpp_qr_code_curves_brainpool(dev, apdev): if "curve=" + curve not in info: raise Exception("Curve mismatch for " + curve) +def test_dpp_qr_code_unsupported_curve(dev, apdev): + """DPP QR Code and unsupported curve""" + check_dpp_capab(dev[0]) + + id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode curve=unsupported") + if "FAIL" not in id: + raise Exception("Unsupported curve accepted") + + tests = [ "30", + "305f02010104187f723ed9e1b41979ec5cd02eb82696efc76b40e277661049a00a06082a8648ce3d030101a134033200043f292614dea97c43f500f069e79ae9fb48f8b07369180de5eec8fa2bc9eea5af7a46dc335f52f10cb1c0e9464201d41b" ] + for hex in tests: + id = dev[0].request("DPP_BOOTSTRAP_GEN type=qrcode key=" + hex) + if "FAIL" not in id: + raise Exception("Unsupported/invalid curve accepted") + def test_dpp_qr_code_curve_select(dev, apdev): """DPP QR Code and curve selection""" check_dpp_capab(dev[0], brainpool=True)