]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Configurator netRole for Enrollee
authorJouni Malinen <jouni@codeaurora.org>
Thu, 12 Dec 2019 00:28:39 +0000 (02:28 +0200)
committerJouni Malinen <jouni@codeaurora.org>
Thu, 12 Dec 2019 00:33:00 +0000 (02:33 +0200)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.c
src/common/dpp.h
wpa_supplicant/dpp_supplicant.c

index 00708a822bb42653093463ff5da018182e87a69d..0d0c47ec84514ca97ce09274930f222b93d40dc7 100644 (file)
@@ -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);
index 437dd95249f86bb3c7c5884a92044fa8ab0b97ad..e2e90c807529cf25cd50cba851ff2e4dec2073a2 100644 (file)
@@ -165,6 +165,7 @@ enum dpp_akm {
 enum dpp_netrole {
        DPP_NETROLE_STA,
        DPP_NETROLE_AP,
+       DPP_NETROLE_CONFIGURATOR,
 };
 
 struct dpp_configuration {
index 4638351c0af7078044dca4ef59322f7fd1007566..1c9faa159ec658460ef434555e81cb85dd5756f3 100644 (file)
@@ -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) {