]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Move DPP_EVENT_AUTH_SUCCESS to a helper
authorMichal Kazior <michal@plume.com>
Tue, 11 May 2021 10:56:16 +0000 (10:56 +0000)
committerJouni Malinen <j@w1.fi>
Tue, 29 Nov 2022 11:55:36 +0000 (13:55 +0200)
This event is generated in a couple of places. It'll be easier to extend
the event with additional metadata if it's generated in a single place.

Signed-off-by: Michal Kazior <michal@plume.com>
src/ap/dpp_hostapd.c
src/common/dpp.c
src/common/dpp.h
src/common/dpp_tcp.c
wpa_supplicant/dpp_supplicant.c

index 32ddb3b21a7f8e133de1b83d2986b83fe3044508..00b571eea5eba68528d23e6244f17962afbf84f2 100644 (file)
@@ -1378,8 +1378,7 @@ static void hostapd_dpp_start_gas_client(struct hostapd_data *hapd)
 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);
+       dpp_notify_auth_success(hapd->dpp_auth, initiator);
 #ifdef CONFIG_TESTING_OPTIONS
        if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
                wpa_printf(MSG_INFO,
@@ -3089,8 +3088,7 @@ hostapd_dpp_gas_req_handler(struct hostapd_data *hapd, const u8 *sa,
                 * from TX status handler, but since there was no such handler
                 * call yet, simply send out the event message and proceed with
                 * exchange. */
-               wpa_msg(hapd->msg_ctx, MSG_INFO,
-                       DPP_EVENT_AUTH_SUCCESS "init=1");
+               dpp_notify_auth_success(hapd->dpp_auth, 1);
                hapd->dpp_auth_ok_on_ack = 0;
        }
 
index 95f7cbf48323c2bc0a15e34383619e970b81f57a..6e5f1100827be96ff5c72f916c8444727b610603 100644 (file)
@@ -5034,6 +5034,13 @@ void dpp_global_deinit(struct dpp_global *dpp)
 }
 
 
+void dpp_notify_auth_success(struct dpp_authentication *auth, int initiator)
+{
+       wpa_msg(auth->msg_ctx, MSG_INFO, DPP_EVENT_AUTH_SUCCESS "init=%d",
+               initiator);
+}
+
+
 #ifdef CONFIG_DPP2
 
 struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi)
index ea91ece488037efe39efddb1fff63d75630b7184..0def823560a6c9ff5412e855159cabda246ab825 100644 (file)
@@ -820,6 +820,7 @@ struct dpp_global_config {
 struct dpp_global * dpp_global_init(struct dpp_global_config *config);
 void dpp_global_clear(struct dpp_global *dpp);
 void dpp_global_deinit(struct dpp_global *dpp);
+void dpp_notify_auth_success(struct dpp_authentication *auth, int initiator);
 
 /* dpp_reconfig.c */
 
index 3e7aaade1b397dae6e8656988affa0c38078c85d..d226a8a88037b66f3af3d07e4d4b39c03a04ae02 100644 (file)
@@ -371,8 +371,7 @@ static void dpp_controller_auth_success(struct dpp_connection *conn,
                return;
 
        wpa_printf(MSG_DEBUG, "DPP: Authentication succeeded");
-       wpa_msg(conn->msg_ctx, MSG_INFO,
-               DPP_EVENT_AUTH_SUCCESS "init=%d", initiator);
+       dpp_notify_auth_success(auth, initiator);
 #ifdef CONFIG_TESTING_OPTIONS
        if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
                wpa_printf(MSG_INFO,
index 917fae3802d30344559c9ef65cf999eaca50ad6e..f8dd9c155dd4b25da5d5e77adcca1291e561731b 100644 (file)
@@ -1906,7 +1906,7 @@ static void wpas_dpp_start_gas_client(struct wpa_supplicant *wpa_s)
 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);
+       dpp_notify_auth_success(wpa_s->dpp_auth, initiator);
 #ifdef CONFIG_TESTING_OPTIONS
        if (dpp_test == DPP_TEST_STOP_AT_AUTH_CONF) {
                wpa_printf(MSG_INFO,
@@ -4073,7 +4073,7 @@ wpas_dpp_gas_req_handler(void *ctx, void *resp_ctx, const u8 *sa,
                 * TX status handler, but since there was no such handler call
                 * yet, simply send out the event message and proceed with
                 * exchange. */
-               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_AUTH_SUCCESS "init=1");
+               dpp_notify_auth_success(auth, 1);
                wpa_s->dpp_auth_ok_on_ack = 0;
        }