]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear configuration blobs on FLUSH command
authorJouni Malinen <j@w1.fi>
Wed, 8 Jan 2014 14:14:30 +0000 (16:14 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 8 Jan 2014 14:42:15 +0000 (16:42 +0200)
All te network blocks and credentials were already cleared, but
configurations blobs should also be cleared here, e.g., to get
more consistent behavior test cases using EAP-FAST PACs.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/ctrl_iface.c

index 5301ed715e21429f91ce5257d9684922d8792fcb..884acf6c89012ce0032d82e47c16e5ba1e7056be 100644 (file)
@@ -1926,6 +1926,22 @@ void wpa_config_free_cred(struct wpa_cred *cred)
 }
 
 
+void wpa_config_flush_blobs(struct wpa_config *config)
+{
+#ifndef CONFIG_NO_CONFIG_BLOBS
+       struct wpa_config_blob *blob, *prev;
+
+       blob = config->blobs;
+       config->blobs = NULL;
+       while (blob) {
+               prev = blob;
+               blob = blob->next;
+               wpa_config_free_blob(prev);
+       }
+#endif /* CONFIG_NO_CONFIG_BLOBS */
+}
+
+
 /**
  * wpa_config_free - Free configuration data
  * @config: Configuration data from wpa_config_read()
@@ -1935,9 +1951,6 @@ void wpa_config_free_cred(struct wpa_cred *cred)
  */
 void wpa_config_free(struct wpa_config *config)
 {
-#ifndef CONFIG_NO_CONFIG_BLOBS
-       struct wpa_config_blob *blob, *prevblob;
-#endif /* CONFIG_NO_CONFIG_BLOBS */
        struct wpa_ssid *ssid, *prev = NULL;
        struct wpa_cred *cred, *cprev;
 
@@ -1955,15 +1968,7 @@ void wpa_config_free(struct wpa_config *config)
                wpa_config_free_cred(cprev);
        }
 
-#ifndef CONFIG_NO_CONFIG_BLOBS
-       blob = config->blobs;
-       prevblob = NULL;
-       while (blob) {
-               prevblob = blob;
-               blob = blob->next;
-               wpa_config_free_blob(prevblob);
-       }
-#endif /* CONFIG_NO_CONFIG_BLOBS */
+       wpa_config_flush_blobs(config);
 
        wpabuf_free(config->wps_vendor_ext_m1);
        os_free(config->ctrl_interface);
index e24772d111037c95b26654002c455d9b0c2957c8..a98a5aa5324f46645069ceea36b57f38e1f23862 100644 (file)
@@ -979,6 +979,7 @@ void wpa_config_set_blob(struct wpa_config *config,
                         struct wpa_config_blob *blob);
 void wpa_config_free_blob(struct wpa_config_blob *blob);
 int wpa_config_remove_blob(struct wpa_config *config, const char *name);
+void wpa_config_flush_blobs(struct wpa_config *config);
 
 struct wpa_cred * wpa_config_get_cred(struct wpa_config *config, int id);
 struct wpa_cred * wpa_config_add_cred(struct wpa_config *config);
index 32941aeddb63c5778213661ac1fde9070c95ded0..b4dcb39c5fb7cdf18447fe155817a32a680d6654 100644 (file)
@@ -5296,6 +5296,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
        wpa_s->extra_blacklist_count = 0;
        wpa_supplicant_ctrl_iface_remove_network(wpa_s, "all");
        wpa_supplicant_ctrl_iface_remove_cred(wpa_s, "all");
+       wpa_config_flush_blobs(wpa_s->conf);
 
        wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME, 43200);
        wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD, 70);