From 368d6714b95daffe006856a061851bb496e425f4 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 17 Apr 2019 15:16:41 -0700 Subject: [PATCH] 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. --- src/eapol.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eapol.c b/src/eapol.c index 8e4f878c..54a017c1 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -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)