]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Fix auth termination after receiving Configurator backup
authorJouni Malinen <jouni@codeaurora.org>
Thu, 23 Jul 2020 14:57:28 +0000 (17:57 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 23 Jul 2020 15:01:55 +0000 (18:01 +0300)
remove_on_tx_status needs to be set in this case even if
dpp_config_processing=2 is used since there will be no connection
attempt when receiving a Configurator backup instead of station config
object.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/dpp_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index edbe46f27e0290f83530a39b1c2c45245a10a33d..cc35030c99156beb60c6e6ae9fd083dceacad6af 100644 (file)
@@ -1485,6 +1485,7 @@ static int wpas_dpp_handle_key_pkg(struct wpa_supplicant *wpa_s,
 
        wpa_printf(MSG_DEBUG, "DPP: Received Configurator backup");
        wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_RECEIVED);
+       wpa_s->dpp_conf_backup_received = true;
 
        while (key) {
                res = dpp_configurator_from_backup(wpa_s->dpp, key);
@@ -1582,6 +1583,7 @@ static void wpas_dpp_gas_resp_cb(void *ctx, const u8 *addr, u8 dialog_token,
                goto fail;
        }
 
+       wpa_s->dpp_conf_backup_received = false;
        for (i = 0; i < auth->num_conf_obj; i++) {
                res = wpas_dpp_handle_config_obj(wpa_s, auth,
                                                 &auth->conf_obj[i]);
@@ -1625,7 +1627,8 @@ fail:
                wpabuf_free(msg);
 
                /* This exchange will be terminated in the TX status handler */
-               if (wpa_s->conf->dpp_config_processing < 2)
+               if (wpa_s->conf->dpp_config_processing < 2 ||
+                   wpa_s->dpp_conf_backup_received)
                        auth->remove_on_tx_status = 1;
                return;
        }
index 341d84156e5fec1ac3be6f6b5d936953daf99b3c..d845ae2ae50c3f9950b40225ed17593fc431862a 100644 (file)
@@ -1277,6 +1277,7 @@ struct wpa_supplicant {
        unsigned int dpp_resp_retry_time;
        u8 dpp_last_ssid[SSID_MAX_LEN];
        size_t dpp_last_ssid_len;
+       bool dpp_conf_backup_received;
 #ifdef CONFIG_DPP2
        struct dpp_pfs *dpp_pfs;
        int dpp_pfs_fallback;