aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-09-08 13:43:11 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-08 14:08:53 (GMT)
commit7d68241d3e340ca2df2c6d714d7e8cfbaed2aac8 (patch)
tree3f0d6494e8ebefa95a6b5b5cb6b9c267446e380c /wlantest
parenta9eae7efe30b4f2616602b6d2f6198dfd3407074 (diff)
downloadhostap-7d68241d3e340ca2df2c6d714d7e8cfbaed2aac8.zip
hostap-7d68241d3e340ca2df2c6d714d7e8cfbaed2aac8.tar.gz
hostap-7d68241d3e340ca2df2c6d714d7e8cfbaed2aac8.tar.bz2
wlantest: Add IEEE Std 802.11-2012, M.9.1 BIP test vector
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/Makefile1
-rw-r--r--wlantest/test_vectors.c35
2 files changed, 36 insertions, 0 deletions
diff --git a/wlantest/Makefile b/wlantest/Makefile
index a79c7ef..458fa95 100644
--- a/wlantest/Makefile
+++ b/wlantest/Makefile
@@ -76,6 +76,7 @@ TOBJS += crc32.o
TOBJS += ccmp.o
TOBJS += tkip.o
TOBJS += wep.o
+TOBJS += bip.o
../src/utils/libutils.a:
diff --git a/wlantest/test_vectors.c b/wlantest/test_vectors.c
index 5ab0f1d..7fc2381 100644
--- a/wlantest/test_vectors.c
+++ b/wlantest/test_vectors.c
@@ -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();