aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsn_supp
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2015-03-10 11:21:43 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-03-10 11:23:54 -0700
commit4dd28dc25895165566a1c8a9cac7bcd755ff8fe3 (patch)
treed7a99dcc7114a2848063c9bef6b5c94dd97babb4 /src/rsn_supp
parent203eadb9eda41a1dde4a583edb4684319e3f399e (diff)
downloadandroid_external_wpa_supplicant_8-4dd28dc25895165566a1c8a9cac7bcd755ff8fe3.tar.gz
android_external_wpa_supplicant_8-4dd28dc25895165566a1c8a9cac7bcd755ff8fe3.tar.bz2
android_external_wpa_supplicant_8-4dd28dc25895165566a1c8a9cac7bcd755ff8fe3.zip
Cumulative patch from commit 00033a0903f69b2f0e0c048840bff059f5a3eab9
00033a0 OpenSSL: Always accept pinned certificates b2329e4 Add QCA vendor subcmd for Data Offload 1d246a1 Make rate-not-supported debug print more useful 761396e Reject Group Key message 1/2 prior to completion of 4-way handshake 3f0e6ec nl80211: Extend NL80211_CMD_TDLS_OPER to support discovery c10ca2a TDLS: Allow driver to request TDLS Discovery Request initiation 41312fc mesh: Leave mesh in driver setup if initialization fails ac8e074 Clear RSN timers for preauth and PTK rekeying on disassociation f2f65dd Reserve QCA vendor specific nl80211 commands 61..90 088a210 HS 2.0: Add NULL check before dereferencing in hs20-osu-client bea8d9a nl80211: Use the new bridge port option proxyarp_wifi Change-Id: I1ef819ab4efa554f059787e02570f48be39819a6 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/rsn_supp')
-rw-r--r--src/rsn_supp/wpa.c11
-rw-r--r--src/rsn_supp/wpa_i.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index b892a66d..8adeef4a 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -1244,6 +1244,7 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
sm->cur_pmksa = sa;
}
+ sm->msg_3_of_4_ok = 1;
return;
failed:
@@ -1436,6 +1437,12 @@ static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
int rekey, ret;
struct wpa_gtk_data gd;
+ if (!sm->msg_3_of_4_ok) {
+ wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
+ "WPA: Group Key Handshake started prior to completion of 4-way handshake");
+ goto failed;
+ }
+
os_memset(&gd, 0, sizeof(gd));
rekey = wpa_sm_get_state(sm) == WPA_COMPLETED;
@@ -2282,6 +2289,8 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
*/
void wpa_sm_notify_disassoc(struct wpa_sm *sm)
{
+ eloop_cancel_timeout(wpa_sm_start_preauth, sm, NULL);
+ eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
peerkey_deinit(sm);
rsn_preauth_deinit(sm);
pmksa_cache_clear_current(sm);
@@ -2293,6 +2302,8 @@ void wpa_sm_notify_disassoc(struct wpa_sm *sm)
/* Keys are not needed in the WPA state machine anymore */
wpa_sm_drop_sa(sm);
+
+ sm->msg_3_of_4_ok = 0;
}
diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
index 431bb207..965a9c1d 100644
--- a/src/rsn_supp/wpa_i.h
+++ b/src/rsn_supp/wpa_i.h
@@ -23,6 +23,7 @@ struct wpa_sm {
size_t pmk_len;
struct wpa_ptk ptk, tptk;
int ptk_set, tptk_set;
+ unsigned int msg_3_of_4_ok:1;
u8 snonce[WPA_NONCE_LEN];
u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
int renew_snonce;