Message ID | CAFXAJYz3nVT2i3AkoBrCeh+GqkNDrFmriJtfHt=as6j2x4J6jQ@mail.gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ap: only accept message 4 after receiving message 2 | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | fail | error: patch failed: src/eapol.c:2092 error: src/eapol.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch |
Hi Mathy, On 1/29/24 10:11, Mathy Vanhoef wrote: > We found that when IWD is operating in AP mode, it doesn't verify > whether message 2 was already received before processing message 4. > > I've included a candidate commit message and patch below. My mailing > client might destroy the spacing, but the small patch should > illustrate the possible fix. Ah nice catch. Thank you. I created a commit based on your patch / description. Applied now as: 6415420f1c92 ("ap: only accept ptk 4/4 after receiving ptk 2/4") Regards, -Denis
diff --git a/src/eapol.c b/src/eapol.c index bad4bbb7..3ce14d5c 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -2092,6 +2092,10 @@ static void eapol_handle_ptk_4_of_4(struct eapol_sm *sm, if (L_BE64_TO_CPU(ek->key_replay_counter) != sm->replay_counter) return; + /* Ensure we received Message 2 and thus have a PTK to verify MIC */ + if (!sm->handshake->have_snonce) + return; + kck = handshake_state_get_kck(sm->handshake); if (!eapol_verify_mic(sm->handshake->akm_suite, kck, ek,