From 98a4cd447e9f1322f9f1e93a4deb34a51b10ca4d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 14 Jan 2015 13:24:09 +0200 Subject: [PATCH] D-Bus: Clear cached EAP data on network profile changes This makes D-Bus network profile Set(Properties) clear cached EAP data similarly to how SET_NETWORK does for control interface. Signed-off-by: Jouni Malinen --- wpa_supplicant/dbus/dbus_new_handlers.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index 9aff2c13a..0b0292070 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -254,6 +254,19 @@ dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s, if (wpa_config_set(ssid, entry.key, value, 0) < 0) goto error; + if (os_strcmp(entry.key, "bssid") != 0 && + os_strcmp(entry.key, "priority") != 0) + wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid); + + if (wpa_s->current_ssid == ssid || + wpa_s->current_ssid == NULL) { + /* + * Invalidate the EAP session cache if anything in the + * current or previously used configuration changes. + */ + eapol_sm_invalidate_cached_session(wpa_s->eapol); + } + if ((os_strcmp(entry.key, "psk") == 0 && value[0] == '"' && ssid->ssid_len) || (os_strcmp(entry.key, "ssid") == 0 && ssid->passphrase))