aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/rx_data.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-13 10:40:36 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-13 10:40:36 (GMT)
commit4dac84539e126abb42b28d1fb9b8b4e5d6b3635a (patch)
treebf6281ffade4a6c2c1dc2d44f042ae0bb8d27267 /wlantest/rx_data.c
parent6c9c5137836ea264f24b758305b616063aeb987a (diff)
downloadhostap-4dac84539e126abb42b28d1fb9b8b4e5d6b3635a.zip
hostap-4dac84539e126abb42b28d1fb9b8b4e5d6b3635a.tar.gz
hostap-4dac84539e126abb42b28d1fb9b8b4e5d6b3635a.tar.bz2
wlantest: Implement TKIP replay detection
Diffstat (limited to 'wlantest/rx_data.c')
-rw-r--r--wlantest/rx_data.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/wlantest/rx_data.c b/wlantest/rx_data.c
index ffeb556..ab0ab0f 100644
--- a/wlantest/rx_data.c
+++ b/wlantest/rx_data.c
@@ -979,8 +979,10 @@ static void rx_data_bss_prot_group(struct wlantest *wt,
return;
}
- /* TODO: different replay protection for TKIP */
- ccmp_get_pn(pn, data);
+ if (bss->group_cipher == WPA_CIPHER_TKIP)
+ tkip_get_pn(pn, data);
+ else
+ ccmp_get_pn(pn, data);
if (os_memcmp(pn, bss->rsc[keyid], 6) <= 0) {
wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: SA=" MACSTR,
MAC2STR(hdr->addr2));
@@ -1061,7 +1063,10 @@ static void rx_data_bss_prot(struct wlantest *wt,
rsc = sta->rsc_fromds[tid];
- ccmp_get_pn(pn, data);
+ if (sta->pairwise_cipher == WPA_CIPHER_TKIP)
+ tkip_get_pn(pn, data);
+ else
+ ccmp_get_pn(pn, data);
if (os_memcmp(pn, rsc, 6) <= 0) {
wpa_printf(MSG_INFO, "CCMP/TKIP replay detected: SA=" MACSTR,
MAC2STR(hdr->addr2));