1
From a7f10d65f40939d855fd996374e465d7c55b797f Mon Sep 17 00:00:00 2001
2
From: Jouni Malinen <j@w1.fi>
3
Date: Fri, 10 Aug 2012 18:05:03 +0300
4
Subject: [PATCH] PMKSA: Set cur_pmksa pointer during initial association
6
cur_pmksa was left to NULL during the initial association. This can
7
result in unexpected behavior, e.g., in expiring PMKSA cache entries
8
since the current entry is not locked in that case. Fix this by updated
9
cur_pmksa when adding the initial PMKSA entry during msg 1/4 processing.
11
Signed-hostap: Jouni Malinen <j@w1.fi>
12
intended-for: hostap-1
14
src/rsn_supp/wpa.c | 12 +++++++++---
15
1 file changed, 9 insertions(+), 3 deletions(-)
17
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
18
index c181c51..d7d7963 100644
19
--- a/src/rsn_supp/wpa.c
20
+++ b/src/rsn_supp/wpa.c
21
@@ -190,13 +190,16 @@ static int wpa_supplicant_get_pmk(struct wpa_sm *sm,
22
#endif /* CONFIG_IEEE80211R */
25
+ struct rsn_pmksa_cache_entry *sa = NULL;
26
wpa_hexdump_key(MSG_DEBUG, "WPA: PMK from EAPOL state "
27
"machines", sm->pmk, pmk_len);
28
sm->pmk_len = pmk_len;
29
if (sm->proto == WPA_PROTO_RSN) {
30
- pmksa_cache_add(sm->pmksa, sm->pmk, pmk_len,
31
- src_addr, sm->own_addr,
32
- sm->network_ctx, sm->key_mgmt);
33
+ sa = pmksa_cache_add(sm->pmksa,
35
+ src_addr, sm->own_addr,
39
if (!sm->cur_pmksa && pmkid &&
40
pmksa_cache_get(sm->pmksa, src_addr, pmkid, NULL))
41
@@ -207,6 +210,9 @@ static int wpa_supplicant_get_pmk(struct wpa_sm *sm,
42
"matches with the PMKID");
49
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
50
"WPA: Failed to get master session key from "