From cc97b53528908b4fce1fd4b2002fb77ee1d68021 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 18 May 2015 13:09:36 -0500 Subject: [PATCH] unit: Add WPA1 GTK Step 2/2 test data + test --- unit/test-eapol.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/unit/test-eapol.c b/unit/test-eapol.c index 9593160f..b4da8e5b 100644 --- a/unit/test-eapol.c +++ b/unit/test-eapol.c @@ -1096,6 +1096,53 @@ static struct eapol_key_data eapol_key_test_23 = { .key_data_len = 32, }; +/* + * WPA Group Handshake frame, 2 of 2. For parameters + * see eapol_wpa2_handshake_test + */ +static const unsigned char eapol_key_data_24[] = { + 0x01, 0x03, 0x00, 0x5f, 0xfe, 0x03, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x06, 0x47, + 0x53, 0x9a, 0x1d, 0x3f, 0x9c, 0x02, 0x50, 0xb5, 0xc0, 0x40, 0x6b, 0x97, + 0xf8, 0x00, 0x00, +}; + +static struct eapol_key_data eapol_key_test_24 = { + .frame = eapol_key_data_24, + .frame_len = sizeof(eapol_key_data_24), + .protocol_version = EAPOL_PROTOCOL_VERSION_2001, + .packet_len = 95, + .descriptor_type = EAPOL_DESCRIPTOR_TYPE_WPA, + .key_descriptor_version = EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_MD5_ARC4, + .key_type = false, + .wpa_key_id = 2, + .install = false, + .key_ack = false, + .key_mic = true, + .secure = true, + .error = false, + .request = false, + .encrypted_key_data = false, + .smk_message = false, + .key_length = 0, + .key_replay_counter = 2, + .key_nonce = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .eapol_key_iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .key_rsc = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .key_mic_data = { 0x4f, 0x06, 0x47, 0x53, 0x9a, 0x1d, 0x3f, 0x9c, 0x02, + 0x50, 0xb5, 0xc0, 0x40, 0x6b, 0x97, 0xf8 }, + .key_data_len = 0, +}; + static void eapol_key_test(const void *data) { const struct eapol_key_data *test = data; @@ -1956,6 +2003,8 @@ int main(int argc, char *argv[]) eapol_key_test, &eapol_key_test_22); l_test_add("/EAPoL Key/Key Frame 23", eapol_key_test, &eapol_key_test_23); + l_test_add("/EAPoL Key/Key Frame 24", + eapol_key_test, &eapol_key_test_24); l_test_add("/EAPoL Key/MIC Test 1", eapol_key_mic_test, &eapol_key_mic_test_1);