From 3058ee3fd1ddb042c51d5f64e1e53ce96cb156ae Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 13 Feb 2015 11:23:54 -0600 Subject: [PATCH] unit: Add EAPoL WPA2 Step 3 of 4 Frame --- unit/test-eapol.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/unit/test-eapol.c b/unit/test-eapol.c index 36d322ca..4dde8988 100644 --- a/unit/test-eapol.c +++ b/unit/test-eapol.c @@ -246,6 +246,54 @@ static struct eapol_key_data eapol_key_test_4 = { .key_data_len = 22, }; +/* WPA2 frame, 3 of 4. For parameters see eapol_4way_test */ +static const unsigned char eapol_key_data_5[] = { + 0x02, 0x03, 0x00, 0x97, 0x02, 0x13, 0xca, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0xc2, 0xbb, 0x57, 0xab, 0x58, 0x8f, 0x92, + 0xeb, 0xbd, 0x44, 0xe8, 0x11, 0x09, 0x4f, 0x60, 0x1c, 0x08, 0x79, 0x86, + 0x03, 0x0c, 0x3a, 0xc7, 0x49, 0xcc, 0x61, 0xd6, 0x3e, 0x33, 0x83, 0x2e, + 0x50, 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, 0xf5, 0x35, 0xd9, + 0x18, 0x09, 0x73, 0x1a, 0x1d, 0x29, 0x08, 0x94, 0x70, 0x5e, 0x91, 0x9c, + 0x8e, 0x00, 0x38, 0x19, 0x18, 0xdf, 0x1e, 0xf0, 0xe7, 0x69, 0x66, 0x52, + 0xe2, 0x57, 0x93, 0x80, 0x34, 0xe1, 0x70, 0x38, 0xb9, 0x8b, 0x4c, 0x45, + 0xa9, 0x23, 0xb7, 0xb6, 0xfa, 0x8c, 0x33, 0xe3, 0x7b, 0xdc, 0xd4, 0x7f, + 0xea, 0xb1, 0x1c, 0x22, 0x6a, 0x2c, 0x5e, 0x38, 0xd5, 0xad, 0x79, 0x94, + 0x05, 0xd6, 0x10, 0xa6, 0x95, 0x51, 0xd6, 0x0b, 0xe6, 0x0a, 0x5b, +}; + +static struct eapol_key_data eapol_key_test_5 = { + .frame = eapol_key_data_5, + .frame_len = sizeof(eapol_key_data_5), + .protocol_version = EAPOL_PROTOCOL_VERSION_2004, + .packet_len = 151, + .descriptor_type = EAPOL_DESCRIPTOR_TYPE_80211, + .key_descriptor_version = EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_SHA1_AES, + .key_type = true, + .install = true, + .key_ack = true, + .key_mic = true, + .secure = true, + .error = false, + .request = false, + .encrypted_key_data = true, + .smk_message = false, + .key_length = 16, + .key_replay_counter = + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, + .key_nonce = { 0xc2, 0xbb, 0x57, 0xab, 0x58, 0x8f, 0x92, 0xeb, 0xbd, + 0x44, 0xe8, 0x11, 0x09, 0x4f, 0x60, 0x1c, 0x08, 0x79, + 0x86, 0x03, 0x0c, 0x3a, 0xc7, 0x49, 0xcc, 0x61, 0xd6, + 0x3e, 0x33, 0x83, 0x2e, 0x50, }, + .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 = { 0xf5, 0x35, 0xd9, 0x18, 0x09, 0x73, 0x1a, 0x1d, 0x29, + 0x08, 0x94, 0x70, 0x5e, 0x91, 0x9c, 0x8e }, + .key_data_len = 56, +}; + static void eapol_key_test(const void *data) { const struct eapol_key_data *test = data; @@ -464,6 +512,8 @@ int main(int argc, char *argv[]) eapol_key_test, &eapol_key_test_3); l_test_add("/EAPoL Key/Key Frame 4", eapol_key_test, &eapol_key_test_4); + l_test_add("/EAPoL Key/Key Frame 5", + eapol_key_test, &eapol_key_test_5); l_test_add("/EAPoL Key/MIC Test 1", eapol_key_mic_test, &eapol_key_mic_test_1);