From 9ffec2e854719ffc133bc0b4f01aad8f07915403 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 24 Mar 2019 22:17:49 +0200 Subject: [PATCH] DPP: Make pkhash available in bootstrapping info This can be helpful for testing DPP2 Controller functionality (get pkhash from Controller to Relay). Signed-off-by: Jouni Malinen --- src/common/dpp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/dpp.c b/src/common/dpp.c index 6f0d91dcd..470d91c73 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -8534,20 +8534,25 @@ int dpp_bootstrap_info(struct dpp_global *dpp, int id, char *reply, int reply_size) { struct dpp_bootstrap_info *bi; + char pkhash[2 * SHA256_MAC_LEN + 1]; bi = dpp_bootstrap_get_id(dpp, id); if (!bi) return -1; + wpa_snprintf_hex(pkhash, sizeof(pkhash), bi->pubkey_hash, + SHA256_MAC_LEN); return os_snprintf(reply, reply_size, "type=%s\n" "mac_addr=" MACSTR "\n" "info=%s\n" "num_freq=%u\n" - "curve=%s\n", + "curve=%s\n" + "pkhash=%s\n", dpp_bootstrap_type_txt(bi->type), MAC2STR(bi->mac_addr), bi->info ? bi->info : "", bi->num_freq, - bi->curve->name); + bi->curve->name, + pkhash); }