aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/rx_data.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-13 09:36:37 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-13 09:36:37 (GMT)
commit2924b0eb791bd100e9ce38dbd6f30b552252639e (patch)
tree0b04fe6a390fd512f1fd989c07f1c07caa494ad6 /wlantest/rx_data.c
parenta9dd29d3e1eb0d7159e8dc0f06f131de553db884 (diff)
downloadhostap-2924b0eb791bd100e9ce38dbd6f30b552252639e.zip
hostap-2924b0eb791bd100e9ce38dbd6f30b552252639e.tar.gz
hostap-2924b0eb791bd100e9ce38dbd6f30b552252639e.tar.bz2
wlantest: Add support for TKIP decryption
Diffstat (limited to 'wlantest/rx_data.c')
-rw-r--r--wlantest/rx_data.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/wlantest/rx_data.c b/wlantest/rx_data.c
index 5a8f0f3..5ab7596 100644
--- a/wlantest/rx_data.c
+++ b/wlantest/rx_data.c
@@ -941,6 +941,7 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
return;
}
+ /* TODO: different replay protection for TKIP */
ccmp_get_pn(pn, data);
if (os_memcmp(pn, bss->rsc[keyid], 6) <= 0) {
wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: SA=" MACSTR,
@@ -949,9 +950,12 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
wpa_hexdump(MSG_INFO, "RSC", bss->rsc[keyid], 6);
}
- /* TODO: TKIP */
-
- decrypted = ccmp_decrypt(bss->gtk[keyid], hdr, data, len, &dlen);
+ if (bss->group_cipher == WPA_CIPHER_TKIP)
+ decrypted = tkip_decrypt(bss->gtk[keyid], hdr, data, len,
+ &dlen);
+ else
+ decrypted = ccmp_decrypt(bss->gtk[keyid], hdr, data, len,
+ &dlen);
if (decrypted) {
rx_data_process(wt, dst, src, decrypted, dlen, 1);
os_memcpy(bss->rsc[keyid], pn, 6);
@@ -1027,9 +1031,10 @@ static void rx_data_bss_prot(struct wlantest *wt,
wpa_hexdump(MSG_INFO, "RSC", rsc, 6);
}
- /* TODO: TKIP */
-
- decrypted = ccmp_decrypt(sta->ptk.tk1, hdr, data, len, &dlen);
+ if (sta->pairwise_cipher == WPA_CIPHER_TKIP)
+ decrypted = tkip_decrypt(sta->ptk.tk1, hdr, data, len, &dlen);
+ else
+ decrypted = ccmp_decrypt(sta->ptk.tk1, hdr, data, len, &dlen);
if (decrypted) {
rx_data_process(wt, dst, src, decrypted, dlen, 1);
os_memcpy(rsc, pn, 6);