]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Add IEEE Std 802.11-2012, M.9.1 BIP test vector
authorJouni Malinen <j@w1.fi>
Sat, 8 Sep 2012 13:43:11 +0000 (16:43 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 8 Sep 2012 14:08:53 +0000 (17:08 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

wlantest/Makefile
wlantest/test_vectors.c

index a79c7efbba16b661d8ce8ea2bca25113909cde08..458fa953daa061aa840b06256b2838634c91131c 100644 (file)
@@ -76,6 +76,7 @@ TOBJS += crc32.o
 TOBJS += ccmp.o
 TOBJS += tkip.o
 TOBJS += wep.o
+TOBJS += bip.o
 
 
 ../src/utils/libutils.a:
index 5ab0f1dd68f553a10290d5978bc708162518c16b..7fc2381a8c80b928925dd75bc7c346bb3e6f7555 100644 (file)
@@ -104,6 +104,40 @@ static void test_vector_ccmp(void)
 }
 
 
+static void test_vector_bip(void)
+{
+       u8 igtk[] = {
+               0x4e, 0xa9, 0x54, 0x3e, 0x09, 0xcf, 0x2b, 0x1e,
+               0xca, 0x66, 0xff, 0xc5, 0x8b, 0xde, 0xcb, 0xcf
+       };
+       u8 ipn[] = { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 };
+       u8 frame[] = {
+               0xc0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+               0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+               0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
+               0x02, 0x00
+       };
+       u8 *prot;
+       size_t prot_len;
+
+       wpa_printf(MSG_INFO, "\nIEEE Std 802.11-2012, M.9.1 BIP with broadcast "
+                  "Deauthentication frame\n");
+
+       wpa_hexdump(MSG_INFO, "IGTK", igtk, sizeof(igtk));
+       wpa_hexdump(MSG_INFO, "IPN", ipn, sizeof(ipn));
+       wpa_hexdump(MSG_INFO, "Plaintext frame", frame, sizeof(frame));
+
+       prot = bip_protect(igtk, frame, sizeof(frame), ipn, 4, &prot_len);
+       if (prot == NULL) {
+               wpa_printf(MSG_ERROR, "Failed to protect BIP frame");
+               return;
+       }
+
+       wpa_hexdump(MSG_INFO, "Protected MPDU (without FCS)", prot, prot_len);
+       os_free(prot);
+}
+
+
 static void test_vector_ccmp_mgmt(void)
 {
        u8 tk[] = { 0x66, 0xed, 0x21, 0x04, 0x2f, 0x9f, 0x26, 0xd7,
@@ -147,6 +181,7 @@ int main(int argc, char *argv[])
 
        test_vector_tkip();
        test_vector_ccmp();
+       test_vector_bip();
        test_vector_ccmp_mgmt();
 
        os_program_deinit();