]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Expose config object PSK/passphrase in wpa_supplicant
authorMichal Kazior <michal@plume.com>
Mon, 8 Feb 2021 15:32:06 +0000 (15:32 +0000)
committerJouni Malinen <j@w1.fi>
Tue, 9 Feb 2021 18:46:36 +0000 (20:46 +0200)
hostapd was already exposing this. There's no reason not to expose it in
wpa_supplicant. This allows 3rd party apps interacting with the control
interface to handle DPP events to get configs instead of needing to
dance around with update_config=1 and SAVE_CONFIG.

Signed-off-by: Michal Kazior <michal@plume.com>
wpa_supplicant/dpp_supplicant.c

index 282b6cd7534ee1dbbe99bca96cc1d0c61cc5bde4..6a08ff8666bc71c9fb3c628aa1b8e2110702ad57 100644 (file)
@@ -1460,6 +1460,21 @@ static int wpas_dpp_handle_config_obj(struct wpa_supplicant *wpa_s,
                wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONNECTOR "%s",
                        conf->connector);
        }
+       if (conf->passphrase[0]) {
+               char hex[64 * 2 + 1];
+
+               wpa_snprintf_hex(hex, sizeof(hex),
+                                (const u8 *) conf->passphrase,
+                                os_strlen(conf->passphrase));
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONFOBJ_PASS "%s",
+                       hex);
+       } else if (conf->psk_set) {
+               char hex[PMK_LEN * 2 + 1];
+
+               wpa_snprintf_hex(hex, sizeof(hex), conf->psk, PMK_LEN);
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONFOBJ_PSK "%s",
+                       hex);
+       }
        if (conf->c_sign_key) {
                char *hex;
                size_t hexlen;