]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Make pkhash available in bootstrapping info
authorJouni Malinen <jouni@codeaurora.org>
Sun, 24 Mar 2019 20:17:49 +0000 (22:17 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 21 Apr 2019 20:14:37 +0000 (23:14 +0300)
This can be helpful for testing DPP2 Controller functionality (get
pkhash from Controller to Relay).

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.c

index 6f0d91dcd9933db6be782376198cfcde90e28f27..470d91c73c0965b005a393714ebaa18719639974 100644 (file)
@@ -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);
 }