]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Extend dpp_test 89 functionality to transmit side
authorSrinivas Dasari <dasaris@codeaurora.org>
Wed, 7 Mar 2018 11:56:26 +0000 (17:26 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 12 Mar 2018 23:03:37 +0000 (01:03 +0200)
This extends dpp_test functionality to allow DPP exchanges to be stopped
after authentication is completed on the Initiator, i.e., after sending
out the Authentication Confirm message. Previously, dpp_test=89 was used
only on the Responder side to stop after receiving the Authentication
Confirm message. The main use case for this extended functionality is to
be able to stop the protocol exchange on a device that acts as
authentication Initiator and Enrollee.

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

index 5dc408bcc4f66e31e3c3a3a3b764187221e4427e..0bebe59360dfed68b66cda022237550f529abe6c 100644 (file)
@@ -1145,6 +1145,17 @@ static void hostapd_dpp_auth_success(struct hostapd_data *hapd, int initiator)
        wpa_printf(MSG_DEBUG, "DPP: Authentication succeeded");
        wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_AUTH_SUCCESS "init=%d",
                initiator);
+#ifdef CONFIG_TESTING_OPTIONS
+       if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
+               wpa_printf(MSG_INFO,
+                          "DPP: TESTING - stop at Authentication Confirm");
+               if (hapd->dpp_auth->configurator) {
+                       /* Prevent GAS response */
+                       hapd->dpp_auth->auth_success = 0;
+               }
+               return;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
 
        if (!hapd->dpp_auth->configurator)
                hostapd_dpp_start_gas_client(hapd);
index 9755ecee147b102b1a86e2da43fb6d845f98d2e4..57ba7bcbf86b19f7d2a43173829e6623543aacef 100644 (file)
@@ -1434,6 +1434,17 @@ static void wpas_dpp_auth_success(struct wpa_supplicant *wpa_s, int initiator)
 {
        wpa_printf(MSG_DEBUG, "DPP: Authentication succeeded");
        wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_AUTH_SUCCESS "init=%d", initiator);
+#ifdef CONFIG_TESTING_OPTIONS
+       if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
+               wpa_printf(MSG_INFO,
+                          "DPP: TESTING - stop at Authentication Confirm");
+               if (wpa_s->dpp_auth->configurator) {
+                       /* Prevent GAS response */
+                       wpa_s->dpp_auth->auth_success = 0;
+               }
+               return;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
 
        if (wpa_s->dpp_auth->configurator)
                wpas_dpp_start_gas_server(wpa_s);