]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Add peer=id entry for PKEX-over-TCP case
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 22 Jul 2022 18:04:08 +0000 (21:04 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 22 Jul 2022 18:04:08 +0000 (21:04 +0300)
The peer=<id> information about the specific boostrapping key provided
through PKEX was added for Public Action frame cases, but the TCP
variant did not do same. Add the same information there to maintain
knowledge of the specific peer bootstrapping key from PKEX to
Authentication exchange.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/dpp_hostapd.c
wpa_supplicant/dpp_supplicant.c

index ed4625dde64099eb4306bbf6e6f40a909973307c..37969a364b067f993e7cd0b1934149ce2f0f00cf 100644 (file)
@@ -300,7 +300,7 @@ static int hostapd_dpp_pkex_done(void *ctx, void *conn,
                                 struct dpp_bootstrap_info *peer_bi)
 {
        struct hostapd_data *hapd = ctx;
-       const char *cmd = hapd->dpp_pkex_auth_cmd;
+       char cmd[500];
        const char *pos;
        u8 allowed_roles = DPP_CAPAB_CONFIGURATOR;
        struct dpp_bootstrap_info *own_bi = NULL;
@@ -308,8 +308,8 @@ static int hostapd_dpp_pkex_done(void *ctx, void *conn,
 
        hostapd_dpp_pkex_clear_code(hapd);
 
-       if (!cmd)
-               cmd = "";
+       os_snprintf(cmd, sizeof(cmd), " peer=%u %s", peer_bi->id,
+                   hapd->dpp_pkex_auth_cmd ? hapd->dpp_pkex_auth_cmd : "");
        wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
                   cmd);
 
index 7901f01157c75081b1ffa30f26aa8084f646732d..d03e79297feec89a9a05b1b9f500dbec5bdd3102 100644 (file)
@@ -2785,7 +2785,7 @@ static int wpas_dpp_pkex_done(void *ctx, void *conn,
                              struct dpp_bootstrap_info *peer_bi)
 {
        struct wpa_supplicant *wpa_s = ctx;
-       const char *cmd = wpa_s->dpp_pkex_auth_cmd;
+       char cmd[500];
        const char *pos;
        u8 allowed_roles = DPP_CAPAB_CONFIGURATOR;
        struct dpp_bootstrap_info *own_bi = NULL;
@@ -2793,8 +2793,8 @@ static int wpas_dpp_pkex_done(void *ctx, void *conn,
 
        wpas_dpp_pkex_clear_code(wpa_s);
 
-       if (!cmd)
-               cmd = "";
+       os_snprintf(cmd, sizeof(cmd), " peer=%u %s", peer_bi->id,
+                   wpa_s->dpp_pkex_auth_cmd ? wpa_s->dpp_pkex_auth_cmd : "");
        wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
                   cmd);