@@ -124,6 +124,16 @@ enum dpp_connector_key {
#define DPP_MAX_HASH_LEN 64
#define DPP_MAX_SHARED_SECRET_LEN 66
#define DPP_CP_LEN 64
+#define DPP_CHIRPHASHSTR \
+ "%02x%02x%02x%02x%02x%02x%02x%02x" \
+ "%02x%02x%02x%02x%02x%02x%02x%02x" \
+ "%02x%02x%02x%02x%02x%02x%02x%02x" \
+ "%02x%02x%02x%02x%02x%02x%02x%02x"
+#define DPP_CHIRPHASH2STR(a) \
+ a[ 0], a[ 1], a[ 2], a[ 3], a[ 4], a[ 5], a[ 6], a[ 7], \
+ a[ 8], a[ 9], a[10], a[11], a[12], a[13], a[14], a[15], \
+ a[16], a[17], a[18], a[19], a[20], a[21], a[22], a[23], \
+ a[24], a[25], a[26], a[27], a[28], a[29], a[30], a[31]
struct dpp_curve_params {
const char *name;
@@ -202,6 +202,7 @@ extern "C" {
#define DPP_EVENT_MUD_URL "DPP-MUD-URL "
#define DPP_EVENT_BAND_SUPPORT "DPP-BAND-SUPPORT "
#define DPP_EVENT_CSR "DPP-CSR "
+#define DPP_EVENT_CHIRP_RX "DPP-CHIRP-RX "
/* MESH events */
#define MESH_GROUP_STARTED "MESH-GROUP-STARTED "
@@ -1975,6 +1975,7 @@ wpas_dpp_rx_presence_announcement(struct wpa_supplicant *wpa_s, const u8 *src,
"Missing or invalid required Responder Bootstrapping Key Hash attribute");
return;
}
+ wpas_notify_dpp_chirp_received(wpa_s, src, r_bootstrap);
wpa_hexdump(MSG_MSGDUMP, "DPP: Responder Bootstrapping Key Hash",
r_bootstrap, r_bootstrap_len);
peer_bi = dpp_bootstrap_find_chirp(wpa_s->dpp, r_bootstrap);
@@ -24,6 +24,7 @@
#include "p2p_supplicant.h"
#include "sme.h"
#include "notify.h"
+#include "common/dpp.h"
int wpas_notify_supplicant_initialized(struct wpa_global *global)
{
@@ -932,3 +933,14 @@ void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_MESH */
+
+#ifdef CONFIG_DPP2
+
+void wpas_notify_dpp_chirp_received(struct wpa_supplicant *wpa_s,
+ const u8 *src, const u8 *hash)
+{
+ wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CHIRP_RX "src=" MACSTR " hash=" DPP_CHIRPHASHSTR,
+ MAC2STR(src), DPP_CHIRPHASH2STR(hash));
+}
+
+#endif /* CONFIG_DPP2 */
@@ -156,5 +156,7 @@ void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s,
const u8 *peer_addr);
void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
const u8 *peer_addr, u16 reason_code);
+void wpas_notify_dpp_chirp_received(struct wpa_supplicant *wpa_s,
+ const u8 *src, const u8 *hash);
#endif /* NOTIFY_H */
Generate a control event with frame source and chirp hash upon receipt of DPP presence announcement frames. This allows external programs to instrument wpa_supplicant with bootstrapping information on-demand. Signed-off-by: Andrew Beltrano <anbeltra@microsoft.com> --- src/common/dpp.h | 10 ++++++++++ src/common/wpa_ctrl.h | 1 + wpa_supplicant/dpp_supplicant.c | 1 + wpa_supplicant/notify.c | 12 ++++++++++++ wpa_supplicant/notify.h | 2 ++ 5 files changed, 26 insertions(+)