From 0b5f8e3d8e55a96b3788f91db9354dc81dc98e70 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 23 Feb 2022 21:58:07 +0200 Subject: [PATCH] DPP: Clear netrole on starting chirping or reconfiguration A previously set netrole (e.g., from DPP_LISTEN or DPP_AUTH_INIT) could have been used in a following DPP_CHIRP or DPP_RECONFIG operation. This could result in trying to request incorrect configuration and likely rejection from the Configurator. Fix this by clearing the netrole when starting these operations. Signed-off-by: Jouni Malinen --- wpa_supplicant/dpp_supplicant.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index e21e242dd..7bbc43521 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -4216,6 +4216,7 @@ int wpas_dpp_chirp(struct wpa_supplicant *wpa_s, const char *cmd) wpas_dpp_chirp_stop(wpa_s); wpa_s->dpp_allowed_roles = DPP_CAPAB_ENROLLEE; + wpa_s->dpp_netrole = DPP_NETROLE_STA; wpa_s->dpp_qr_mutual = 0; wpa_s->dpp_chirp_bi = bi; wpa_s->dpp_presence_announcement = dpp_build_presence_announcement(bi); @@ -4300,6 +4301,7 @@ int wpas_dpp_reconfig(struct wpa_supplicant *wpa_s, const char *cmd) } wpas_dpp_chirp_stop(wpa_s); wpa_s->dpp_allowed_roles = DPP_CAPAB_ENROLLEE; + wpa_s->dpp_netrole = DPP_NETROLE_STA; wpa_s->dpp_qr_mutual = 0; wpa_s->dpp_reconfig_ssid = ssid; wpa_s->dpp_reconfig_ssid_id = ssid->id;