]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Testing option for Config Object rejction
authorJouni Malinen <jouni@codeaurora.org>
Thu, 14 Mar 2019 15:08:44 +0000 (17:08 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 14 Mar 2019 22:31:09 +0000 (00:31 +0200)
Add a new testing option to force Enrollee to reject the receive Config
Object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/dpp_hostapd.c
src/common/dpp.h
wpa_supplicant/dpp_supplicant.c

index a84654d2d0ddca9b190c823e6c4ba196934b60b6..7184f7204c5281e816c3b81958a40891fb9a140d 100644 (file)
@@ -1119,6 +1119,12 @@ static void hostapd_dpp_gas_resp_cb(void *ctx, const u8 *addr, u8 dialog_token,
 
        hostapd_dpp_handle_config_obj(hapd, auth);
        status = DPP_STATUS_OK;
+#ifdef CONFIG_TESTING_OPTIONS
+       if (dpp_test == DPP_TEST_REJECT_CONFIG) {
+               wpa_printf(MSG_INFO, "DPP: TESTING - Reject Config Object");
+               status = DPP_STATUS_CONFIG_REJECTED;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
 fail:
        if (status != DPP_STATUS_OK)
                wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
index 4af913bc1f4c362b5c74abeb37b7e1f576e9191a..fe4b7f3a29803bcb8a964a4931b69cc49c463c94 100644 (file)
@@ -345,6 +345,7 @@ enum dpp_test_behavior {
        DPP_TEST_STOP_AT_AUTH_RESP = 88,
        DPP_TEST_STOP_AT_AUTH_CONF = 89,
        DPP_TEST_STOP_AT_CONF_REQ = 90,
+       DPP_TEST_REJECT_CONFIG = 91,
 };
 
 extern enum dpp_test_behavior dpp_test;
index 8de53ad8ba55c991ac7cf84d18033a816974cd01..411bfff831d2eaa49e494a16fcf8424611b4f1bc 100644 (file)
@@ -1428,6 +1428,12 @@ static void wpas_dpp_gas_resp_cb(void *ctx, const u8 *addr, u8 dialog_token,
                goto fail;
 
        status = DPP_STATUS_OK;
+#ifdef CONFIG_TESTING_OPTIONS
+       if (dpp_test == DPP_TEST_REJECT_CONFIG) {
+               wpa_printf(MSG_INFO, "DPP: TESTING - Reject Config Object");
+               status = DPP_STATUS_CONFIG_REJECTED;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
 fail:
        if (status != DPP_STATUS_OK)
                wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);