From 3f35ec2dc3d7347560b07635d96b216b950064f8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 19 Nov 2017 12:53:04 +0200 Subject: [PATCH] DPP: Protocol testing for invalid DPP Status value Extend dpp_test to cover cases where DPP Status value is invalid in Authentication Response/Confirm frames. Signed-off-by: Jouni Malinen --- src/common/dpp.c | 10 +++++++++- src/common/dpp.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/dpp.c b/src/common/dpp.c index 0fa8b7839..38dc03f48 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -2618,6 +2618,9 @@ static int dpp_auth_build_resp_ok(struct dpp_authentication *auth) } else if (dpp_test == DPP_TEST_NO_STATUS_AUTH_RESP) { wpa_printf(MSG_INFO, "DPP: TESTING - no Status"); status = 255; + } else if (dpp_test == DPP_TEST_INVALID_STATUS_AUTH_RESP) { + wpa_printf(MSG_INFO, "DPP: TESTING - invalid Status"); + status = 254; } else if (dpp_test == DPP_TEST_NO_R_NONCE_AUTH_RESP) { wpa_printf(MSG_INFO, "DPP: TESTING - no R-nonce"); r_nonce = NULL; @@ -3023,8 +3026,13 @@ static struct wpabuf * dpp_auth_build_conf(struct dpp_authentication *auth, i_pubkey_hash = NULL; #ifdef CONFIG_TESTING_OPTIONS - if (dpp_test == DPP_TEST_NO_STATUS_AUTH_CONF) + if (dpp_test == DPP_TEST_NO_STATUS_AUTH_CONF) { + wpa_printf(MSG_INFO, "DPP: TESTING - no Status"); goto skip_status; + } else if (dpp_test == DPP_TEST_INVALID_STATUS_AUTH_CONF) { + wpa_printf(MSG_INFO, "DPP: TESTING - invalid Status"); + status = 254; + } #endif /* CONFIG_TESTING_OPTIONS */ /* DPP Status */ diff --git a/src/common/dpp.h b/src/common/dpp.h index f8d8a9b41..02a238285 100644 --- a/src/common/dpp.h +++ b/src/common/dpp.h @@ -300,6 +300,8 @@ enum dpp_test_behavior { DPP_TEST_INVALID_I_BOOTSTRAP_KEY_HASH_AUTH_RESP = 71, DPP_TEST_INVALID_R_BOOTSTRAP_KEY_HASH_AUTH_CONF = 72, DPP_TEST_INVALID_I_BOOTSTRAP_KEY_HASH_AUTH_CONF = 73, + DPP_TEST_INVALID_STATUS_AUTH_RESP = 74, + DPP_TEST_INVALID_STATUS_AUTH_CONF = 75, }; extern enum dpp_test_behavior dpp_test;