From 5661ebd774a68ac7efabcf05a70355febee24ebc Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 12 Dec 2019 02:28:39 +0200 Subject: [PATCH] DPP: Configurator netRole for Enrollee Signed-off-by: Jouni Malinen --- src/common/dpp.c | 4 ++++ src/common/dpp.h | 1 + wpa_supplicant/dpp_supplicant.c | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/common/dpp.c b/src/common/dpp.c index 00708a822..0d0c47ec8 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -4740,6 +4740,8 @@ static const char * dpp_netrole_str(enum dpp_netrole netrole) return "sta"; case DPP_NETROLE_AP: return "ap"; + case DPP_NETROLE_CONFIGURATOR: + return "configurator"; default: return "??"; } @@ -5317,6 +5319,8 @@ dpp_conf_req_rx(struct dpp_authentication *auth, const u8 *attr_start, netrole = DPP_NETROLE_STA; } else if (os_strcmp(token->string, "ap") == 0) { netrole = DPP_NETROLE_AP; + } else if (os_strcmp(token->string, "configurator") == 0) { + netrole = DPP_NETROLE_CONFIGURATOR; } else { wpa_printf(MSG_DEBUG, "DPP: Unsupported netRole '%s'", token->string); diff --git a/src/common/dpp.h b/src/common/dpp.h index 437dd9524..e2e90c807 100644 --- a/src/common/dpp.h +++ b/src/common/dpp.h @@ -165,6 +165,7 @@ enum dpp_akm { enum dpp_netrole { DPP_NETROLE_STA, DPP_NETROLE_AP, + DPP_NETROLE_CONFIGURATOR, }; struct dpp_configuration { diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index 4638351c0..1c9faa159 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -680,6 +680,8 @@ int wpas_dpp_auth_init(struct wpa_supplicant *wpa_s, const char *cmd) pos += 9; if (os_strncmp(pos, "ap", 2) == 0) wpa_s->dpp_netrole = DPP_NETROLE_AP; + else if (os_strncmp(pos, "configurator", 12) == 0) + wpa_s->dpp_netrole = DPP_NETROLE_CONFIGURATOR; else wpa_s->dpp_netrole = DPP_NETROLE_STA; } @@ -835,6 +837,8 @@ int wpas_dpp_listen(struct wpa_supplicant *wpa_s, const char *cmd) wpa_s->dpp_qr_mutual = os_strstr(cmd, " qr=mutual") != NULL; if (os_strstr(cmd, " netrole=ap")) wpa_s->dpp_netrole = DPP_NETROLE_AP; + else if (os_strstr(cmd, " netrole=configurator")) + wpa_s->dpp_netrole = DPP_NETROLE_CONFIGURATOR; else wpa_s->dpp_netrole = DPP_NETROLE_STA; if (wpa_s->dpp_listen_freq == (unsigned int) freq) {