WPA: Check wpa_eapol_key_mic() result on TX

Verify that nothing unexpected happened with EAPOL-Key Key MIC
calculation when transmitting EAPOL-Key frames from the Authenticator.
This should not be able to happen in practice, but if if it does, there
is no point in sending out the frame without the correct Key MIC value.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-11-24 12:13:26 +02:00 committed by Jouni Malinen
parent 5da4b2f386
commit beae255a72

View file

@ -1571,9 +1571,12 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
return; return;
} }
wpa_eapol_key_mic(sm->PTK.kck, sm->PTK.kck_len, if (wpa_eapol_key_mic(sm->PTK.kck, sm->PTK.kck_len,
sm->wpa_key_mgmt, version, sm->wpa_key_mgmt, version,
(u8 *) hdr, len, key_mic); (u8 *) hdr, len, key_mic) < 0) {
os_free(hdr);
return;
}
#ifdef CONFIG_TESTING_OPTIONS #ifdef CONFIG_TESTING_OPTIONS
if (!pairwise && if (!pairwise &&
wpa_auth->conf.corrupt_gtk_rekey_mic_probability > 0.0 && wpa_auth->conf.corrupt_gtk_rekey_mic_probability > 0.0 &&