]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Protocol testing for invalid DPP Status value
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 19 Nov 2017 10:53:04 +0000 (12:53 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 19 Nov 2017 12:13:16 +0000 (14:13 +0200)
Extend dpp_test to cover cases where DPP Status value is invalid in
Authentication Response/Confirm frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/common/dpp.c
src/common/dpp.h

index 0fa8b783910b8da469146376a23456a04a7b34d2..38dc03f48c31c8b5fbfc1c7065a845e92bbea379 100644 (file)
@@ -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 */
index f8d8a9b41b1534a72ad9320e7e108cefae19c2c4..02a238285fcb0f4b61459af5a9970957ac59656a 100644 (file)
@@ -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;