aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-06-26 02:00:23 (GMT)
committerJouni Malinen <j@w1.fi>2005-06-26 02:00:23 (GMT)
commit34ab43210848f74ff8254e6ee349c4401786e84f (patch)
treeb2e79119039e92ae1accb63b378e8dc8ff201748
parentdb3872a0d35a3c37765c7b89a7e8bb88bb933f26 (diff)
downloadhostap-history-34ab43210848f74ff8254e6ee349c4401786e84f.zip
hostap-history-34ab43210848f74ff8254e6ee349c4401786e84f.tar.gz
hostap-history-34ab43210848f74ff8254e6ee349c4401786e84f.tar.bz2
Do not replace existing PMKSA entry for the same authenticator if PMK
and PMKID remain the same.
-rw-r--r--wpa_supplicant/preauth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/preauth.c b/wpa_supplicant/preauth.c
index 04ed268..20acda5 100644
--- a/wpa_supplicant/preauth.c
+++ b/wpa_supplicant/preauth.c
@@ -194,6 +194,14 @@ pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk,
prev = NULL;
while (pos) {
if (memcmp(aa, pos->aa, ETH_ALEN) == 0) {
+ if (pos->pmk_len == pmk_len &&
+ memcmp(pos->pmk, pmk, pmk_len) == 0 &&
+ memcmp(pos->pmkid, entry->pmkid, PMKID_LEN) == 0) {
+ wpa_printf(MSG_DEBUG, "WPA: reusing previous "
+ "PMKSA entry");
+ free(entry);
+ return pos;
+ }
if (prev == NULL)
sm->pmksa = pos->next;
else