DPP: Work arouind missing Auth Confirm ACK for testing

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>
This commit is contained in:
Jouni Malinen 2024-01-14 12:10:04 +02:00
parent bcc28d4453
commit f9b3ecb0ad
2 changed files with 14 additions and 0 deletions

View file

@ -3094,6 +3094,13 @@ hostapd_dpp_gas_req_handler(struct hostapd_data *hapd, const u8 *sa,
* exchange. */ * exchange. */
dpp_notify_auth_success(hapd->dpp_auth, 1); dpp_notify_auth_success(hapd->dpp_auth, 1);
hapd->dpp_auth_ok_on_ack = 0; 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, wpa_hexdump(MSG_DEBUG,

View file

@ -4131,6 +4131,13 @@ wpas_dpp_gas_req_handler(void *ctx, void *resp_ctx, const u8 *sa,
* exchange. */ * exchange. */
dpp_notify_auth_success(auth, 1); dpp_notify_auth_success(auth, 1);
wpa_s->dpp_auth_ok_on_ack = 0; 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, wpa_hexdump(MSG_DEBUG,