]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Clear netrole on starting chirping or reconfiguration
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 23 Feb 2022 19:58:07 +0000 (21:58 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 23 Feb 2022 22:23:25 +0000 (00:23 +0200)
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 <jouni@qca.qualcomm.com>
wpa_supplicant/dpp_supplicant.c

index e21e242dd1e552ec57977617136ae927715a54c5..7bbc435215295a4f6bc2f581ec4f75d38b281464 100644 (file)
@@ -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;