wlantest: Add IEEE Std 802.11-2012, M.9.2 CCMP (mgmt) test vector

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2012-09-08 16:21:57 +03:00
parent 3ae8968679
commit 6522984086

View file

@ -104,6 +104,39 @@ static void test_vector_ccmp(void)
}
static void test_vector_ccmp_mgmt(void)
{
u8 tk[] = { 0x66, 0xed, 0x21, 0x04, 0x2f, 0x9f, 0x26, 0xd7,
0x11, 0x57, 0x06, 0xe4, 0x04, 0x14, 0xcf, 0x2e };
u8 pn[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
u8 frame[] = {
0xc0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
0x02, 0x00
};
u8 *enc;
size_t enc_len;
wpa_printf(MSG_INFO, "\nIEEE Std 802.11-2012, M.9.2 CCMP with unicast "
"Deauthentication frame\n");
wpa_hexdump(MSG_INFO, "TK", tk, sizeof(tk));
wpa_hexdump(MSG_INFO, "PN", pn, sizeof(pn));
wpa_hexdump(MSG_INFO, "802.11 Header", frame, 24);
wpa_hexdump(MSG_INFO, "Plaintext Data", frame + 24, sizeof(frame) - 24);
enc = ccmp_encrypt(tk, frame, sizeof(frame), 24, NULL, pn, 0, &enc_len);
if (enc == NULL) {
wpa_printf(MSG_ERROR, "Failed to encrypt CCMP frame");
return;
}
wpa_hexdump(MSG_INFO, "Encrypted MPDU (without FCS)", enc, enc_len);
os_free(enc);
}
int main(int argc, char *argv[])
{
wpa_debug_level = MSG_EXCESSIVE;
@ -114,6 +147,7 @@ int main(int argc, char *argv[])
test_vector_tkip();
test_vector_ccmp();
test_vector_ccmp_mgmt();
os_program_deinit();