unit: Add WPA1 Step 2/4 test data + test

This commit is contained in:
Denis Kenzior 2015-05-18 13:04:08 -05:00
parent 039ab49357
commit b6677680f2
1 changed files with 48 additions and 0 deletions

View File

@ -911,6 +911,52 @@ static struct eapol_key_data eapol_key_test_19 = {
.key_data_len = 0,
};
/* WPA frame, 2 of 4. For parameters see eapol_wpa2_handshake_test */
static const unsigned char eapol_key_data_20[] = {
0x01, 0x03, 0x00, 0x77, 0xfe, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x88, 0xe2, 0x61, 0x2d, 0xf3, 0xe3,
0x66, 0x3d, 0x35, 0xf7, 0xd3, 0x70, 0x17, 0x87, 0x92, 0x92, 0x4a, 0x35,
0xc8, 0x2d, 0x67, 0x45, 0x56, 0xe6, 0x98, 0x9e, 0x75, 0x79, 0x9e, 0x25,
0x6b, 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, 0x32, 0x5c, 0x17,
0xb7, 0xbc, 0x6d, 0x2c, 0x0f, 0x7c, 0xc0, 0x32, 0xec, 0xa6, 0x31, 0xbd,
0x8d, 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_20 = {
.frame = eapol_key_data_20,
.frame_len = sizeof(eapol_key_data_20),
.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 = false,
.key_ack = false,
.key_mic = true,
.secure = false,
.error = false,
.request = false,
.encrypted_key_data = false,
.smk_message = false,
.key_length = 0,
.key_replay_counter = 0,
.key_nonce = { 0x04, 0x88, 0xe2, 0x61, 0x2d, 0xf3, 0xe3, 0x66, 0x3d,
0x35, 0xf7, 0xd3, 0x70, 0x17, 0x87, 0x92, 0x92, 0x4a,
0x35, 0xc8, 0x2d, 0x67, 0x45, 0x56, 0xe6, 0x98, 0x9e,
0x75, 0x79, 0x9e, 0x25, 0x6b },
.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 = { 0x32, 0x5c, 0x17, 0xb7, 0xbc, 0x6d, 0x2c, 0x0f, 0x7c,
0xc0, 0x32, 0xec, 0xa6, 0x31, 0xbd, 0x8d },
.key_data_len = 24,
};
static void eapol_key_test(const void *data)
{
const struct eapol_key_data *test = data;
@ -1763,6 +1809,8 @@ int main(int argc, char *argv[])
eapol_key_test, &eapol_key_test_18);
l_test_add("/EAPoL Key/Key Frame 19",
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/MIC Test 1",
eapol_key_mic_test, &eapol_key_mic_test_1);