unit: Add EAPoL WPA2 Step 4 of 4 Frame

This commit is contained in:
Denis Kenzior 2015-02-13 13:49:02 -06:00
parent 3058ee3fd1
commit bacd459caf
1 changed files with 46 additions and 0 deletions

View File

@ -294,6 +294,50 @@ static struct eapol_key_data eapol_key_test_5 = {
.key_data_len = 56,
};
/* WPA2 frame, 4 of 4. For parameters see eapol_4way_test */
static const unsigned char eapol_key_data_6[] = {
0x01, 0x03, 0x00, 0x5f, 0x02, 0x03, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 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, 0x9e, 0x57, 0xa4,
0xc0, 0x9b, 0xaf, 0xb3, 0x37, 0x5e, 0x46, 0xd3, 0x86, 0xcf, 0x87, 0x27,
0x53, 0x00, 0x00,
};
static struct eapol_key_data eapol_key_test_6 = {
.frame = eapol_key_data_6,
.frame_len = sizeof(eapol_key_data_6),
.protocol_version = EAPOL_PROTOCOL_VERSION_2001,
.packet_len = 95,
.descriptor_type = EAPOL_DESCRIPTOR_TYPE_80211,
.key_descriptor_version = EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_SHA1_AES,
.key_type = true,
.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 =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
.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 = { 0x9e, 0x57, 0xa4, 0xc0, 0x9b, 0xaf, 0xb3, 0x37, 0x5e,
0x46, 0xd3, 0x86, 0xcf, 0x87, 0x27, 0x53, },
.key_data_len = 0,
};
static void eapol_key_test(const void *data)
{
const struct eapol_key_data *test = data;
@ -514,6 +558,8 @@ int main(int argc, char *argv[])
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/Key Frame 6",
eapol_key_test, &eapol_key_test_6);
l_test_add("/EAPoL Key/MIC Test 1",
eapol_key_mic_test, &eapol_key_mic_test_1);