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,