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 <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2022-07-29 18:55:37 +03:00 committed by Jouni Malinen
parent 10104915af
commit 89de431f23
3 changed files with 19 additions and 10 deletions

View file

@ -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) { if (status == DPP_STATUS_OK && auth->send_conn_status) {
wpa_msg(hapd->msg_ctx, MSG_INFO, 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"); wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
eloop_cancel_timeout(hostapd_dpp_config_result_wait_timeout, eloop_cancel_timeout(hostapd_dpp_config_result_wait_timeout,
hapd, NULL); 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_drv_send_action_cancel_wait(hapd);
hostapd_dpp_listen_stop(hapd); hostapd_dpp_listen_stop(hapd);
if (status == DPP_STATUS_OK) 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 else
wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED); wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
dpp_auth_deinit(auth); 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); hostapd_drv_send_action_cancel_wait(hapd);
if (ok) 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 else
wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED); wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
dpp_auth_deinit(hapd->dpp_auth); dpp_auth_deinit(hapd->dpp_auth);

View file

@ -248,7 +248,8 @@ static void dpp_controller_gas_done(struct dpp_connection *conn)
return; 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); 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); status = dpp_conf_result_rx(auth, hdr, buf, len);
if (status == DPP_STATUS_OK && auth->send_conn_status) { if (status == DPP_STATUS_OK && auth->send_conn_status) {
wpa_msg(msg_ctx, MSG_INFO, wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT
DPP_EVENT_CONF_SENT "wait_conn_status=1"); "wait_conn_status=1 conf_resp_status=%d",
auth->conf_resp_status);
wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result"); wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
auth->waiting_conn_status_result = 1; auth->waiting_conn_status_result = 1;
eloop_cancel_timeout( eloop_cancel_timeout(
@ -893,7 +895,8 @@ static int dpp_controller_rx_conf_result(struct dpp_connection *conn,
return 0; return 0;
} }
if (status == DPP_STATUS_OK) 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 else
wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED); wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
return -1; /* to remove the completed connection */ return -1; /* to remove the completed connection */

View file

@ -2124,7 +2124,8 @@ static void wpas_dpp_rx_conf_result(struct wpa_supplicant *wpa_s, const u8 *src,
int freq; int freq;
wpa_msg(wpa_s, MSG_INFO, 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"); wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
eloop_cancel_timeout(wpas_dpp_config_result_wait_timeout, eloop_cancel_timeout(wpas_dpp_config_result_wait_timeout,
wpa_s, NULL); 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); offchannel_send_action_done(wpa_s);
wpas_dpp_listen_stop(wpa_s); wpas_dpp_listen_stop(wpa_s);
if (status == DPP_STATUS_OK) 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 else
wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED); wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);
dpp_auth_deinit(auth); 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); offchannel_send_action_done(wpa_s);
wpas_dpp_listen_stop(wpa_s); wpas_dpp_listen_stop(wpa_s);
if (ok) 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 else
wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED); wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);
dpp_auth_deinit(wpa_s->dpp_auth); dpp_auth_deinit(wpa_s->dpp_auth);