aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2016-03-09 09:16:13 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-20 15:37:53 (GMT)
commit4c522c7798d16cac0d59de8b23d8202fb9fa8a59 (patch)
tree76236cf289334390665acac3c5f6ee33c6566578 /wpa_supplicant
parentb8daac18a48fc4b12e8cb726ea265e050ef49cdc (diff)
downloadhostap-4c522c7798d16cac0d59de8b23d8202fb9fa8a59.zip
hostap-4c522c7798d16cac0d59de8b23d8202fb9fa8a59.tar.gz
hostap-4c522c7798d16cac0d59de8b23d8202fb9fa8a59.tar.bz2
PMKSA: Flush AP/mesh PMKSA cache by PMKSA_FLUSH command
This extends the wpa_supplicant PMKSA_FLUSH control interface command to allow the PMKSA list from the authenticator side to be flushed for AP and mesh mode. In addition, this adds a hostapd PMKSA_FLUSH control interface command to flush the PMKSA entries. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ap.c14
-rw-r--r--wpa_supplicant/ap.h1
-rw-r--r--wpa_supplicant/ctrl_iface.c11
3 files changed, 25 insertions, 1 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 716fa8a..b133d03 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1404,6 +1404,20 @@ int wpas_ap_pmksa_cache_list(struct wpa_supplicant *wpa_s, char *buf,
}
+void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s)
+{
+ size_t i;
+
+ if (wpa_s->ap_iface) {
+ for (i = 0; i < wpa_s->ap_iface->num_bss; i++)
+ hostapd_ctrl_iface_pmksa_flush(wpa_s->ap_iface->bss[i]);
+ }
+
+ if (wpa_s->ifmsh)
+ hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]);
+}
+
+
#ifdef NEED_AP_MLME
void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
struct dfs_event *radar)
diff --git a/wpa_supplicant/ap.h b/wpa_supplicant/ap.h
index c3c1d9f..5a59ddc 100644
--- a/wpa_supplicant/ap.h
+++ b/wpa_supplicant/ap.h
@@ -84,6 +84,7 @@ int wpas_ap_stop_ap(struct wpa_supplicant *wpa_s);
int wpas_ap_pmksa_cache_list(struct wpa_supplicant *wpa_s, char *buf,
size_t len);
+void wpas_ap_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
struct dfs_event *radar);
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 98f7e29..381d521 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -8368,6 +8368,15 @@ static int wpas_ctrl_iface_pmksa(struct wpa_supplicant *wpa_s,
}
+static void wpas_ctrl_iface_pmksa_flush(struct wpa_supplicant *wpa_s)
+{
+ wpa_sm_pmksa_cache_flush(wpa_s->wpa, NULL);
+#ifdef CONFIG_AP
+ wpas_ap_pmksa_cache_flush(wpa_s);
+#endif /* CONFIG_AP */
+}
+
+
static int wpas_ctrl_cmd_debug_level(const char *cmd)
{
if (os_strcmp(cmd, "PING") == 0 ||
@@ -8441,7 +8450,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strcmp(buf, "PMKSA") == 0) {
reply_len = wpas_ctrl_iface_pmksa(wpa_s, reply, reply_size);
} else if (os_strcmp(buf, "PMKSA_FLUSH") == 0) {
- wpa_sm_pmksa_cache_flush(wpa_s->wpa, NULL);
+ wpas_ctrl_iface_pmksa_flush(wpa_s);
} else if (os_strncmp(buf, "SET ", 4) == 0) {
if (wpa_supplicant_ctrl_iface_set(wpa_s, buf + 4))
reply_len = -1;