From: Jouni Malinen Date: Wed, 23 Feb 2022 19:58:07 +0000 (+0200) Subject: DPP: Clear netrole on starting chirping or reconfiguration X-Git-Tag: hostap_2_11~2215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b5f8e3d8e55a96b3788f91db9354dc81dc98e70;p=thirdparty%2Fhostap.git 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 --- 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;