aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/wlantest.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-25 14:49:18 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-26 23:26:49 (GMT)
commit98cd3d1c3b2f2081539a95be26b37aae88b2b0f5 (patch)
tree7ebb32f2312e9feff800426599b6e27e08b0106a /wlantest/wlantest.c
parent287eb3f9d723cbba9493a89049b98c76d75e129a (diff)
downloadhostap-98cd3d1c3b2f2081539a95be26b37aae88b2b0f5.zip
hostap-98cd3d1c3b2f2081539a95be26b37aae88b2b0f5.tar.gz
hostap-98cd3d1c3b2f2081539a95be26b37aae88b2b0f5.tar.bz2
Preparations for variable length KCK and KEK
This modifies struct wpa_ptk to allow the length of KCK and KEK to be stored. This is needed to allow longer keys to be used, e.g., with Suite B 192-bit level. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest/wlantest.c')
-rw-r--r--wlantest/wlantest.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/wlantest/wlantest.c b/wlantest/wlantest.c
index a214141..ab3b2fc 100644
--- a/wlantest/wlantest.c
+++ b/wlantest/wlantest.c
@@ -1,6 +1,6 @@
/*
* wlantest - IEEE 802.11 protocol monitoring and testing tool
- * Copyright (c) 2010-2013, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2010-2015, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
@@ -210,10 +210,16 @@ static int add_ptk_file(struct wlantest *wt, const char *ptk_file)
if (p == NULL)
break;
if (ptk_len < 48) {
- os_memcpy(p->ptk.tk1, ptk, ptk_len);
+ os_memcpy(p->ptk.tk, ptk, ptk_len);
+ p->ptk.tk_len = ptk_len;
p->ptk_len = 32 + ptk_len;
} else {
- os_memcpy(&p->ptk, ptk, ptk_len);
+ os_memcpy(p->ptk.kck, ptk, 16);
+ p->ptk.kck_len = 16;
+ os_memcpy(p->ptk.kek, ptk + 16, 16);
+ p->ptk.kek_len = 16;
+ os_memcpy(p->ptk.tk, ptk + 32, ptk_len - 32);
+ p->ptk.tk_len = ptk_len - 32;
p->ptk_len = ptk_len;
}
dl_list_add(&wt->ptk, &p->list);