From bbbd8f67d3bae773a858816274daba42faacd8b1 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 18 May 2015 13:04:33 -0500 Subject: [PATCH] unit: Add WPA1 Step 3/4 test data + test --- unit/test-eapol.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/unit/test-eapol.c b/unit/test-eapol.c index 14353062..7e2fbf12 100644 --- a/unit/test-eapol.c +++ b/unit/test-eapol.c @@ -957,6 +957,52 @@ static struct eapol_key_data eapol_key_test_20 = { .key_data_len = 24, }; +/* WPA frame, 3 of 4. For parameters see eapol_wpa2_handshake_test */ +static const unsigned char eapol_key_data_21[] = { + 0x01, 0x03, 0x00, 0x77, 0xfe, 0x01, 0xc9, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x26, 0x56, 0x9b, 0x2a, 0x6e, 0x90, 0xad, + 0x21, 0x91, 0x86, 0x6d, 0x86, 0xe9, 0xfd, 0xf8, 0xb7, 0x9a, 0x12, 0xcb, + 0xab, 0x1a, 0xc3, 0xe0, 0x2d, 0xa6, 0xa1, 0x22, 0x43, 0x4e, 0x76, 0x9d, + 0x75, 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, 0xcd, 0x76, 0x63, + 0x43, 0xe1, 0xc7, 0x6b, 0x59, 0x34, 0xa4, 0x23, 0x42, 0xc0, 0xb9, 0x98, + 0x02, 0x00, 0x18, 0xdd, 0x16, 0x00, 0x50, 0xf2, 0x01, 0x01, 0x00, 0x00, + 0x50, 0xf2, 0x02, 0x01, 0x00, 0x00, 0x50, 0xf2, 0x02, 0x01, 0x00, 0x00, + 0x50, 0xf2, 0x02, +}; + +static struct eapol_key_data eapol_key_test_21 = { + .frame = eapol_key_data_21, + .frame_len = sizeof(eapol_key_data_21), + .protocol_version = EAPOL_PROTOCOL_VERSION_2001, + .packet_len = 119, + .descriptor_type = EAPOL_DESCRIPTOR_TYPE_WPA, + .key_descriptor_version = EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_MD5_ARC4, + .key_type = true, + .wpa_key_id = 0, + .install = true, + .key_ack = true, + .key_mic = true, + .secure = false, + .error = false, + .request = false, + .encrypted_key_data = false, + .smk_message = false, + .key_length = 32, + .key_replay_counter = 1, + .key_nonce = { 0x26, 0x56, 0x9b, 0x2a, 0x6e, 0x90, 0xad, 0x21, 0x91, + 0x86, 0x6d, 0x86, 0xe9, 0xfd, 0xf8, 0xb7, 0x9a, 0x12, + 0xcb, 0xab, 0x1a, 0xc3, 0xe0, 0x2d, 0xa6, 0xa1, 0x22, + 0x43, 0x4e, 0x76, 0x9d, 0x75 }, + .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 = { 0xcd, 0x76, 0x63, 0x43, 0xe1, 0xc7, 0x6b, 0x59, 0x34, + 0xa4, 0x23, 0x42, 0xc0, 0xb9, 0x98, 0x02 }, + .key_data_len = 24, +}; + static void eapol_key_test(const void *data) { const struct eapol_key_data *test = data; @@ -1811,6 +1857,8 @@ int main(int argc, char *argv[]) eapol_key_test, &eapol_key_test_19); l_test_add("/EAPoL Key/Key Frame 20", eapol_key_test, &eapol_key_test_20); + l_test_add("/EAPoL Key/Key Frame 21", + eapol_key_test, &eapol_key_test_21); l_test_add("/EAPoL Key/MIC Test 1", eapol_key_mic_test, &eapol_key_mic_test_1);