aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-04-05 19:18:25 (GMT)
committerJouni Malinen <j@w1.fi>2013-04-05 19:18:25 (GMT)
commitf2f66ad7e805218468aa041985dccaf8719c296e (patch)
treedfbe51cb8a1b34b2cc6d177577c3721f3ad7f2fe /wlantest
parent75fa7d19a4893df18a77427f43789b2922cf353e (diff)
downloadhostap-f2f66ad7e805218468aa041985dccaf8719c296e.zip
hostap-f2f66ad7e805218468aa041985dccaf8719c296e.tar.gz
hostap-f2f66ad7e805218468aa041985dccaf8719c296e.tar.bz2
wlantest: Fix CCMP-256 cipher
TK was incorrectly truncated in a way that resulted in CCMP (128-bit key) encryption being used in practice. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/ccmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wlantest/ccmp.c b/wlantest/ccmp.c
index d7a0e65..ee1f1a6 100644
--- a/wlantest/ccmp.c
+++ b/wlantest/ccmp.c
@@ -199,7 +199,7 @@ u8 * ccmp_256_decrypt(const u8 *tk, const struct ieee80211_hdr *hdr,
wpa_hexdump(MSG_EXCESSIVE, "CCMP-256 AAD", aad, aad_len);
wpa_hexdump(MSG_EXCESSIVE, "CCMP-256 nonce", nonce, 13);
- if (aes_ccm_ad(tk, 16, nonce, 16, data + 8, mlen, aad, aad_len,
+ if (aes_ccm_ad(tk, 32, nonce, 16, data + 8, mlen, aad, aad_len,
data + 8 + mlen, plain) < 0) {
u16 seq_ctrl = le_to_host16(hdr->seq_ctrl);
wpa_printf(MSG_INFO, "Invalid CCMP-256 MIC in frame: A1=" MACSTR
@@ -252,7 +252,7 @@ u8 * ccmp_256_encrypt(const u8 *tk, u8 *frame, size_t len, size_t hdrlen,
wpa_hexdump(MSG_EXCESSIVE, "CCMP-256 AAD", aad, aad_len);
wpa_hexdump(MSG_EXCESSIVE, "CCMP-256 nonce", nonce, 13);
- if (aes_ccm_ae(tk, 16, nonce, 16, frame + hdrlen, plen, aad, aad_len,
+ if (aes_ccm_ae(tk, 32, nonce, 16, frame + hdrlen, plen, aad, aad_len,
pos, pos + plen) < 0) {
os_free(crypt);
return NULL;