path: root/wpa_supplicant/blacklist.c
diff options
authorKevin Lund <kglund@google.com>2020-06-11 21:11:19 (GMT)
committerJouni Malinen <j@w1.fi>2020-10-10 15:34:59 (GMT)
commitcff545720ecd41f9fb56752bf22ef8fde0e237e1 (patch)
tree90f7554401e27c9260acccb5a25a6829a399bc40 /wpa_supplicant/blacklist.c
parentbbbb3c04ef735bdb75f4554dc2bb4a5e937dd09c (diff)
wpa_supplicant: Clear blacklist when SSID configs change
If the stored configurations for an SSID have changed, we can no longer trust the current blacklist state of that SSID, since the updated configs could change the behavior of the network. E.g., the BSS could be blacklisted due to a bad password, and the config could be updated to store the correct password. In this case, keeping the BSS in the blacklist will prevent the user from connecting to the BSS after the correct password has been updated. Add the value was_changed_recently to the wpa_ssid struct. Update this value every time a config is changed through wpa_set_config(). Check this value in wpa_blacklist_get() to clear the blacklist whenever the configs of current_ssid have changed. This solution was chosen over simply clearing the blacklist whenever configs change because the user should be able to change configs on an inactive SSID without affecting the blacklist for the currently active SSID. This way, the blacklist won't be cleared until the user attempts to connect to the inactive network again. Furthermore, the blacklist is stored per-BSSID while configs are stored per-SSID, so we don't have the option to just clear out certain blacklist entries that would be affected by the configs. Finally, the function wpa_supplicant_reload_configuration() causes the configs to be reloaded from scratch, so after a call to this function all bets are off as to the relevance of our current blacklist state. Thus, we clear the entire blacklist within this function. Signed-off-by: Kevin Lund <kglund@google.com> Signed-off-by: Brian Norris <briannorris@chromium.org>
Diffstat (limited to 'wpa_supplicant/blacklist.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/wpa_supplicant/blacklist.c b/wpa_supplicant/blacklist.c
index fa2ad11..2f32644 100644
--- a/wpa_supplicant/blacklist.c
+++ b/wpa_supplicant/blacklist.c
@@ -26,6 +26,13 @@ struct wpa_blacklist * wpa_blacklist_get(struct wpa_supplicant *wpa_s,
if (wpa_s == NULL || bssid == NULL)
return NULL;
+ if (wpa_s->current_ssid &&
+ wpa_s->current_ssid->was_recently_reconfigured) {
+ wpa_blacklist_clear(wpa_s);
+ wpa_s->current_ssid->was_recently_reconfigured = false;
+ return NULL;
+ }
e = wpa_s->blacklist;