From 0ea28ba5ad0fd65e438f94010eaa02833f36ac6a Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Wed, 6 May 2015 01:48:37 +0200 Subject: [PATCH] eapol: Generate new snonce on new 4-Way Handshake Make sure that we handle PTK rekeying. --- src/eapol.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index d87b3bd0..adeed36a 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -664,16 +664,14 @@ static void eapol_handle_ptk_1_of_4(uint32_t ifindex, struct eapol_sm *sm, return; } - if (!sm->have_snonce) { - if (!get_nonce(sm->snonce)) { - handshake_failed(ifindex, sm, - MPDU_REASON_CODE_UNSPECIFIED); - return; - } - - sm->have_snonce = true; + if (!get_nonce(sm->snonce)) { + handshake_failed(ifindex, sm, MPDU_REASON_CODE_UNSPECIFIED); + return; } + sm->have_snonce = true; + sm->ptk_complete = false; + memcpy(sm->anonce, ek->key_nonce, sizeof(ek->key_nonce)); crypto_derive_pairwise_ptk(sm->pmk, sm->spa, sm->aa,