3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 02:19:26 +01:00

eapol: Update _verify_ptk_3_of_4 to work with no MIC

A similar change was made to _verify_gtk_1_of_2 in order for
verification to work when no MIC is being used (FILS rekeys)
This commit is contained in:
James Prestwood 2019-04-25 12:52:46 -07:00 committed by Denis Kenzior
parent 8ceb4a31ef
commit 733679ff7f
2 changed files with 6 additions and 4 deletions

View File

@ -478,7 +478,8 @@ bool eapol_verify_ptk_2_of_4(const struct eapol_key *ek)
return true; return true;
} }
bool eapol_verify_ptk_3_of_4(const struct eapol_key *ek, bool is_wpa) bool eapol_verify_ptk_3_of_4(const struct eapol_key *ek, bool is_wpa,
size_t mic_len)
{ {
uint16_t key_len; uint16_t key_len;
@ -497,7 +498,7 @@ bool eapol_verify_ptk_3_of_4(const struct eapol_key *ek, bool is_wpa)
if (!ek->key_ack) if (!ek->key_ack)
return false; return false;
if (!ek->key_mic) if (mic_len && !ek->key_mic)
return false; return false;
if (ek->secure != !is_wpa) if (ek->secure != !is_wpa)
@ -1449,7 +1450,7 @@ static void eapol_handle_ptk_3_of_4(struct eapol_sm *sm,
l_debug("ifindex=%u", sm->handshake->ifindex); l_debug("ifindex=%u", sm->handshake->ifindex);
if (!eapol_verify_ptk_3_of_4(ek, sm->handshake->wpa_ie)) { if (!eapol_verify_ptk_3_of_4(ek, sm->handshake->wpa_ie, sm->mic_len)) {
handshake_failed(sm, MMPDU_REASON_CODE_UNSPECIFIED); handshake_failed(sm, MMPDU_REASON_CODE_UNSPECIFIED);
return; return;
} }

View File

@ -63,7 +63,8 @@ uint8_t *eapol_decrypt_key_data(enum ie_rsn_akm_suite akm, const uint8_t *kek,
bool eapol_verify_ptk_1_of_4(const struct eapol_key *ek, size_t mic_len); bool eapol_verify_ptk_1_of_4(const struct eapol_key *ek, size_t mic_len);
bool eapol_verify_ptk_2_of_4(const struct eapol_key *ek); bool eapol_verify_ptk_2_of_4(const struct eapol_key *ek);
bool eapol_verify_ptk_3_of_4(const struct eapol_key *ek, bool is_wpa); bool eapol_verify_ptk_3_of_4(const struct eapol_key *ek, bool is_wpa,
size_t mic_len);
bool eapol_verify_ptk_4_of_4(const struct eapol_key *ek, bool is_wpa); bool eapol_verify_ptk_4_of_4(const struct eapol_key *ek, bool is_wpa);
bool eapol_verify_gtk_1_of_2(const struct eapol_key *ek, bool is_wpa, bool eapol_verify_gtk_1_of_2(const struct eapol_key *ek, bool is_wpa,
size_t mic_len); size_t mic_len);