]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Work arouind missing Auth Confirm ACK for testing
authorJouni Malinen <j@w1.fi>
Sun, 14 Jan 2024 10:10:04 +0000 (12:10 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Jan 2024 10:10:04 +0000 (12:10 +0200)
The dpp_test DPP_TEST_STOP_AT_AUTH_CONF case is supposed to prevent the
GAS exchange from happening. It was possible to bypass that testing
functionality if the TX status event for the Authentication Confirm
message was lost or delayed long enough for the GAS Request to be
proessed first. This could happen at least with UML time travel.

Work around this by checking for the special dpp_test case within GAS
request handling.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/dpp_hostapd.c
wpa_supplicant/dpp_supplicant.c

index c4baa801402b771b49d635c7c3f3cc20bf15ffd2..2813155b967273e9feb9dd5e685ae2f6047624d0 100644 (file)
@@ -3094,6 +3094,13 @@ hostapd_dpp_gas_req_handler(struct hostapd_data *hapd, const u8 *sa,
                 * exchange. */
                dpp_notify_auth_success(hapd->dpp_auth, 1);
                hapd->dpp_auth_ok_on_ack = 0;
+#ifdef CONFIG_TESTING_OPTIONS
+               if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
+                       wpa_printf(MSG_INFO,
+                                  "DPP: TESTING - stop at Authentication Confirm");
+                       return NULL;
+               }
+#endif /* CONFIG_TESTING_OPTIONS */
        }
 
        wpa_hexdump(MSG_DEBUG,
index a0505aa913f2f4e0141de28645dad4ee6e1cc4a6..21ad685f2ae0198a4d8278f3251e5b2614bdb678 100644 (file)
@@ -4131,6 +4131,13 @@ wpas_dpp_gas_req_handler(void *ctx, void *resp_ctx, const u8 *sa,
                 * exchange. */
                dpp_notify_auth_success(auth, 1);
                wpa_s->dpp_auth_ok_on_ack = 0;
+#ifdef CONFIG_TESTING_OPTIONS
+               if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
+                       wpa_printf(MSG_INFO,
+                                  "DPP: TESTING - stop at Authentication Confirm");
+                       return NULL;
+               }
+#endif /* CONFIG_TESTING_OPTIONS */
        }
 
        wpa_hexdump(MSG_DEBUG,