3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 11:52:34 +01:00

eapol: allow _create_gtk_2_of_2 to work without MIC

FILS does not use a MIC, as well as requires encrypted data on GTK 2/2.
This updates eapol_create_gtk_2_of_2 to pass in extra data to
eapol_create_common, which will reserve room for this encrypted data.
Extra data is only reserved if mic_len == 0.
This commit is contained in:
James Prestwood 2019-04-17 15:16:41 -07:00 committed by Denis Kenzior
parent ca63ac2342
commit 368d6714b9

View File

@ -700,11 +700,14 @@ struct eapol_key *eapol_create_gtk_2_of_2(
bool is_wpa, uint8_t wpa_key_id, size_t mic_len)
{
uint8_t snonce[32];
uint8_t extra[16] = { 0 };
struct eapol_key *step2;
memset(snonce, 0, sizeof(snonce));
step2 = eapol_create_common(protocol, version, true,
key_replay_counter, snonce, 0, NULL,
key_replay_counter, snonce,
(mic_len) ? 0 : 16,
(mic_len) ? NULL : extra,
0, is_wpa, mic_len);
if (!step2)