]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Report received messages as control interface events
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 22 Oct 2017 09:10:47 +0000 (12:10 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 22 Oct 2017 14:21:57 +0000 (17:21 +0300)
This is helpful for testing purposes and also for upper layer components
that may want to show more detailed progress through a DPP exchange.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/dpp_hostapd.c
src/common/wpa_ctrl.h
wpa_supplicant/dpp_supplicant.c

index 825af9e3be1fc264c8840567e708e55a62096baa..f0b8634b31c2fadff1735376e682dc07756ea83f 100644 (file)
@@ -1184,11 +1184,20 @@ void hostapd_dpp_rx_action(struct hostapd_data *hapd, const u8 *src,
        if (crypto_suite != 1) {
                wpa_printf(MSG_DEBUG, "DPP: Unsupported crypto suite %u",
                           crypto_suite);
+               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_RX "src=" MACSTR
+                       " freq=%u type=%d ignore=unsupported-crypto-suite",
+                       MAC2STR(src), freq, type);
                return;
        }
        wpa_hexdump(MSG_MSGDUMP, "DPP: Received message attributes", buf, len);
-       if (dpp_check_attrs(buf, len) < 0)
+       if (dpp_check_attrs(buf, len) < 0) {
+               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_RX "src=" MACSTR
+                       " freq=%u type=%d ignore=invalid-attributes",
+                       MAC2STR(src), freq, type);
                return;
+       }
+       wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_RX "src=" MACSTR
+               " freq=%u type=%d", MAC2STR(src), freq, type);
 
        switch (type) {
        case DPP_PA_AUTHENTICATION_REQ:
index e4fb53c1524bde583cec26e833438d695ce4ae05..35980e259277cb5888daf7037d11eaccb9067fad 100644 (file)
@@ -167,6 +167,7 @@ extern "C" {
 #define DPP_EVENT_NET_ACCESS_KEY "DPP-NET-ACCESS-KEY "
 #define DPP_EVENT_MISSING_CONNECTOR "DPP-MISSING-CONNECTOR "
 #define DPP_EVENT_NETWORK_ID "DPP-NETWORK-ID "
+#define DPP_EVENT_RX "DPP-RX "
 
 /* MESH events */
 #define MESH_GROUP_STARTED "MESH-GROUP-STARTED "
index e0638f3a7f3bd9babd6f5425a8b39c0ed30393bb..982783ae6f5a1c2175f7a014174ce45844287a83 100644 (file)
@@ -1567,11 +1567,20 @@ void wpas_dpp_rx_action(struct wpa_supplicant *wpa_s, const u8 *src,
        if (crypto_suite != 1) {
                wpa_printf(MSG_DEBUG, "DPP: Unsupported crypto suite %u",
                           crypto_suite);
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_RX "src=" MACSTR
+                       " freq=%u type=%d ignore=unsupported-crypto-suite",
+                       MAC2STR(src), freq, type);
                return;
        }
        wpa_hexdump(MSG_MSGDUMP, "DPP: Received message attributes", buf, len);
-       if (dpp_check_attrs(buf, len) < 0)
+       if (dpp_check_attrs(buf, len) < 0) {
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_RX "src=" MACSTR
+                       " freq=%u type=%d ignore=invalid-attributes",
+                       MAC2STR(src), freq, type);
                return;
+       }
+       wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_RX "src=" MACSTR " freq=%u type=%d",
+               MAC2STR(src), freq, type);
 
        switch (type) {
        case DPP_PA_AUTHENTICATION_REQ: