From e4e95aabbfbc080f7ff91a6ee96a637217a73b1f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 12 Aug 2020 11:41:52 +0300 Subject: [PATCH] DPP2: Allow Controller to be configured to require QR mutual auth Extend the DPP_CONTROLLER_START command to accept the optional qr=mutual parameter similarly to the DPP_LISTEN case. Signed-off-by: Jouni Malinen --- src/common/dpp.h | 1 + src/common/dpp_tcp.c | 2 +- wpa_supplicant/dpp_supplicant.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/dpp.h b/src/common/dpp.h index 8243a97b6..feee8e1e8 100644 --- a/src/common/dpp.h +++ b/src/common/dpp.h @@ -384,6 +384,7 @@ struct dpp_controller_config { const char *configurator_params; int tcp_port; u8 allowed_roles; + int qr_mutual; }; #ifdef CONFIG_TESTING_OPTIONS diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c index 33874400e..53fe67f81 100644 --- a/src/common/dpp_tcp.c +++ b/src/common/dpp_tcp.c @@ -1622,7 +1622,7 @@ int dpp_controller_start(struct dpp_global *dpp, os_strdup(config->configurator_params); dl_list_init(&ctrl->conn); ctrl->allowed_roles = config->allowed_roles; - ctrl->qr_mutual = 0; + ctrl->qr_mutual = config->qr_mutual; ctrl->sock = socket(AF_INET, SOCK_STREAM, 0); if (ctrl->sock < 0) diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index 224c40b9b..3119445ac 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -3350,6 +3350,8 @@ int wpas_dpp_controller_start(struct wpa_supplicant *wpa_s, const char *cmd) else return -1; } + + config.qr_mutual = os_strstr(cmd, " qr=mutual") != NULL; } config.configurator_params = wpa_s->dpp_configurator_params; return dpp_controller_start(wpa_s->dpp, &config);