]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Add DPP-CONFOBJ-PASS/PSK events for hostapd legacy configuration
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 15 Sep 2017 14:45:06 +0000 (17:45 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 15 Sep 2017 14:45:06 +0000 (17:45 +0300)
These control interface event messages can be used to allow hostapd AP
to be configured for legacy WPA2-Personal configuration with DPP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/dpp_hostapd.c
src/common/wpa_ctrl.h

index 27caa64078ea2927f5bedbb4377be8a1a10f0726..8b6a630c41c82cd45d66336344fceb32652edce2 100644 (file)
@@ -689,6 +689,20 @@ static void hostapd_dpp_gas_resp_cb(void *ctx, const u8 *addr, u8 dialog_token,
                 * message. */
                wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONNECTOR "%s",
                        auth->connector);
+       } else if (auth->passphrase[0]) {
+               char hex[64 * 2 + 1];
+
+               wpa_snprintf_hex(hex, sizeof(hex),
+                                (const u8 *) auth->passphrase,
+                                os_strlen(auth->passphrase));
+               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONFOBJ_PASS "%s",
+                       hex);
+       } else if (auth->psk_set) {
+               char hex[PMK_LEN * 2 + 1];
+
+               wpa_snprintf_hex(hex, sizeof(hex), auth->psk, PMK_LEN);
+               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONFOBJ_PSK "%s",
+                       hex);
        }
        if (auth->c_sign_key) {
                char *hex;
index f7b063a5c74e98c4ffd462ce3821e43fcdef26ba..c59bc608f6cf454351530cf1d30b6d71ce816f48 100644 (file)
@@ -152,6 +152,8 @@ extern "C" {
 #define DPP_EVENT_CONF_SENT "DPP-CONF-SENT "
 #define DPP_EVENT_CONF_FAILED "DPP-CONF-FAILED "
 #define DPP_EVENT_CONFOBJ_SSID "DPP-CONFOBJ-SSID "
+#define DPP_EVENT_CONFOBJ_PASS "DPP-CONFOBJ-PASS "
+#define DPP_EVENT_CONFOBJ_PSK "DPP-CONFOBJ-PSK "
 #define DPP_EVENT_CONNECTOR "DPP-CONNECTOR "
 #define DPP_EVENT_C_SIGN_KEY "DPP-C-SIGN-KEY "
 #define DPP_EVENT_NET_ACCESS_KEY "DPP-NET-ACCESS-KEY "