DPP: Configurator netRole for Enrollee

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-12-12 02:28:39 +02:00
parent 7404574458
commit 5661ebd774
3 changed files with 9 additions and 0 deletions

View file

@ -4740,6 +4740,8 @@ static const char * dpp_netrole_str(enum dpp_netrole netrole)
return "sta"; return "sta";
case DPP_NETROLE_AP: case DPP_NETROLE_AP:
return "ap"; return "ap";
case DPP_NETROLE_CONFIGURATOR:
return "configurator";
default: default:
return "??"; return "??";
} }
@ -5317,6 +5319,8 @@ dpp_conf_req_rx(struct dpp_authentication *auth, const u8 *attr_start,
netrole = DPP_NETROLE_STA; netrole = DPP_NETROLE_STA;
} else if (os_strcmp(token->string, "ap") == 0) { } else if (os_strcmp(token->string, "ap") == 0) {
netrole = DPP_NETROLE_AP; netrole = DPP_NETROLE_AP;
} else if (os_strcmp(token->string, "configurator") == 0) {
netrole = DPP_NETROLE_CONFIGURATOR;
} else { } else {
wpa_printf(MSG_DEBUG, "DPP: Unsupported netRole '%s'", wpa_printf(MSG_DEBUG, "DPP: Unsupported netRole '%s'",
token->string); token->string);

View file

@ -165,6 +165,7 @@ enum dpp_akm {
enum dpp_netrole { enum dpp_netrole {
DPP_NETROLE_STA, DPP_NETROLE_STA,
DPP_NETROLE_AP, DPP_NETROLE_AP,
DPP_NETROLE_CONFIGURATOR,
}; };
struct dpp_configuration { struct dpp_configuration {

View file

@ -680,6 +680,8 @@ int wpas_dpp_auth_init(struct wpa_supplicant *wpa_s, const char *cmd)
pos += 9; pos += 9;
if (os_strncmp(pos, "ap", 2) == 0) if (os_strncmp(pos, "ap", 2) == 0)
wpa_s->dpp_netrole = DPP_NETROLE_AP; wpa_s->dpp_netrole = DPP_NETROLE_AP;
else if (os_strncmp(pos, "configurator", 12) == 0)
wpa_s->dpp_netrole = DPP_NETROLE_CONFIGURATOR;
else else
wpa_s->dpp_netrole = DPP_NETROLE_STA; 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; wpa_s->dpp_qr_mutual = os_strstr(cmd, " qr=mutual") != NULL;
if (os_strstr(cmd, " netrole=ap")) if (os_strstr(cmd, " netrole=ap"))
wpa_s->dpp_netrole = DPP_NETROLE_AP; wpa_s->dpp_netrole = DPP_NETROLE_AP;
else if (os_strstr(cmd, " netrole=configurator"))
wpa_s->dpp_netrole = DPP_NETROLE_CONFIGURATOR;
else else
wpa_s->dpp_netrole = DPP_NETROLE_STA; wpa_s->dpp_netrole = DPP_NETROLE_STA;
if (wpa_s->dpp_listen_freq == (unsigned int) freq) { if (wpa_s->dpp_listen_freq == (unsigned int) freq) {