aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-06-24 03:11:36 (GMT)
committerJouni Malinen <j@w1.fi>2005-06-24 03:11:36 (GMT)
commit87ed5ee968b0f59452d3a41382de973b80bb1425 (patch)
tree240554555f6838e7a0def976479d1669db35a923
parentbeaa1ce25528e2acbe7bf304fe060e0123b838aa (diff)
downloadhostap-history-87ed5ee968b0f59452d3a41382de973b80bb1425.zip
hostap-history-87ed5ee968b0f59452d3a41382de973b80bb1425.tar.gz
hostap-history-87ed5ee968b0f59452d3a41382de973b80bb1425.tar.bz2
Remove PMK/PTK, disconnect, and try to reassociate if the current
PMKSA cache entry expires.
-rw-r--r--wpa_supplicant/preauth.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/wpa_supplicant/preauth.c b/wpa_supplicant/preauth.c
index 318a90b..796194c 100644
--- a/wpa_supplicant/preauth.c
+++ b/wpa_supplicant/preauth.c
@@ -77,13 +77,21 @@ static void pmksa_cache_set_expiration(struct wpa_sm *sm);
static void pmksa_cache_free_entry(struct wpa_sm *sm,
struct rsn_pmksa_cache *entry)
{
+ int current;
+
+ current = sm->cur_pmksa == entry ||
+ (sm->pmk_len = entry->pmk_len &&
+ memcmp(sm->pmk, entry->pmk, sm->pmk_len) == 0);
+
free(entry);
sm->pmksa_count--;
- if (sm->cur_pmksa == entry) {
+
+ if (current) {
wpa_printf(MSG_DEBUG, "RSN: removed current PMKSA entry");
- /* TODO: should drop PMK and PTK and trigger new key
- * negotiation */
sm->cur_pmksa = NULL;
+ memset(sm->pmk, 0, sizeof(sm->pmk));
+ wpa_supplicant_deauthenticate(sm->ctx, REASON_UNSPECIFIED);
+ wpa_supplicant_req_scan(sm->ctx, 0, 0);
}
}