From 89de431f23e0ec9b912339dd431e9144d1beb4b5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 29 Jul 2022 18:55:37 +0300 Subject: [PATCH] DPP: Add config response status value to DPP-CONF-SENT This can be helpful for upper layers to be able to determine whether the configuration was rejected. Signed-off-by: Jouni Malinen --- src/ap/dpp_hostapd.c | 9 ++++++--- src/common/dpp_tcp.c | 11 +++++++---- wpa_supplicant/dpp_supplicant.c | 9 ++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c index 7c7b29705..7055784c4 100644 --- a/src/ap/dpp_hostapd.c +++ b/src/ap/dpp_hostapd.c @@ -1583,7 +1583,8 @@ static void hostapd_dpp_rx_conf_result(struct hostapd_data *hapd, const u8 *src, if (status == DPP_STATUS_OK && auth->send_conn_status) { wpa_msg(hapd->msg_ctx, MSG_INFO, - DPP_EVENT_CONF_SENT "wait_conn_status=1"); + DPP_EVENT_CONF_SENT "wait_conn_status=1 conf_status=%d", + auth->conf_resp_status); wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result"); eloop_cancel_timeout(hostapd_dpp_config_result_wait_timeout, hapd, NULL); @@ -1599,7 +1600,8 @@ static void hostapd_dpp_rx_conf_result(struct hostapd_data *hapd, const u8 *src, hostapd_drv_send_action_cancel_wait(hapd); hostapd_dpp_listen_stop(hapd); if (status == DPP_STATUS_OK) - wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT); + wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT + "conf_status=%d", auth->conf_resp_status); else wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED); dpp_auth_deinit(auth); @@ -3142,7 +3144,8 @@ void hostapd_dpp_gas_status_handler(struct hostapd_data *hapd, int ok) hostapd_drv_send_action_cancel_wait(hapd); if (ok) - wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT); + wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT + "conf_status=%d", auth->conf_resp_status); else wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED); dpp_auth_deinit(hapd->dpp_auth); diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c index e16d9b09b..ff18a9929 100644 --- a/src/common/dpp_tcp.c +++ b/src/common/dpp_tcp.c @@ -248,7 +248,8 @@ static void dpp_controller_gas_done(struct dpp_connection *conn) return; } - wpa_msg(conn->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT); + wpa_msg(conn->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT "conf_status=%d", + auth->conf_resp_status); dpp_connection_remove(conn); } @@ -880,8 +881,9 @@ static int dpp_controller_rx_conf_result(struct dpp_connection *conn, status = dpp_conf_result_rx(auth, hdr, buf, len); if (status == DPP_STATUS_OK && auth->send_conn_status) { - wpa_msg(msg_ctx, MSG_INFO, - DPP_EVENT_CONF_SENT "wait_conn_status=1"); + wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT + "wait_conn_status=1 conf_resp_status=%d", + auth->conf_resp_status); wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result"); auth->waiting_conn_status_result = 1; eloop_cancel_timeout( @@ -893,7 +895,8 @@ static int dpp_controller_rx_conf_result(struct dpp_connection *conn, return 0; } if (status == DPP_STATUS_OK) - wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT); + wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT + "conf_resp_status=%d", auth->conf_resp_status); else wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED); return -1; /* to remove the completed connection */ diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index fa636fca0..8071eced7 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -2124,7 +2124,8 @@ static void wpas_dpp_rx_conf_result(struct wpa_supplicant *wpa_s, const u8 *src, int freq; wpa_msg(wpa_s, MSG_INFO, - DPP_EVENT_CONF_SENT "wait_conn_status=1"); + DPP_EVENT_CONF_SENT "wait_conn_status=1 conf_status=%d", + auth->conf_resp_status); wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result"); eloop_cancel_timeout(wpas_dpp_config_result_wait_timeout, wpa_s, NULL); @@ -2144,7 +2145,8 @@ static void wpas_dpp_rx_conf_result(struct wpa_supplicant *wpa_s, const u8 *src, offchannel_send_action_done(wpa_s); wpas_dpp_listen_stop(wpa_s); if (status == DPP_STATUS_OK) - wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT); + wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT "conf_status=%d", + auth->conf_resp_status); else wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED); dpp_auth_deinit(auth); @@ -4194,7 +4196,8 @@ wpas_dpp_gas_status_handler(void *ctx, struct wpabuf *resp, int ok) offchannel_send_action_done(wpa_s); wpas_dpp_listen_stop(wpa_s); if (ok) - wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT); + wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT "conf_status=%d", + auth->conf_resp_status); else wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED); dpp_auth_deinit(wpa_s->dpp_auth);