3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

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

This commit is contained in:
Denis Kenzior 2015-05-18 13:03:26 -05:00
parent 6c9bf06f73
commit 039ab49357

View File

@ -867,6 +867,50 @@ static struct eapol_key_data eapol_key_test_18 = {
.key_data_len = 0,
};
/* WPA frame, 1 of 4. For parameters see eapol_wpa2_handshake_test */
static const unsigned char eapol_key_data_19[] = {
0x01, 0x03, 0x00, 0x5f, 0xfe, 0x00, 0x89, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
};
static struct eapol_key_data eapol_key_test_19 = {
.frame = eapol_key_data_19,
.frame_len = sizeof(eapol_key_data_19),
.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 = true,
.wpa_key_id = 0,
.install = false,
.key_ack = true,
.key_mic = false,
.secure = false,
.error = false,
.request = false,
.encrypted_key_data = false,
.smk_message = false,
.key_length = 32,
.key_replay_counter = 0,
.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 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.key_data_len = 0,
};
static void eapol_key_test(const void *data)
{
const struct eapol_key_data *test = data;
@ -1717,6 +1761,8 @@ int main(int argc, char *argv[])
eapol_key_test, &eapol_key_test_17);
l_test_add("/EAPoL Key/Key Frame 18",
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/MIC Test 1",
eapol_key_mic_test, &eapol_key_mic_test_1);