aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/tkip.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/tkip.c
parent6c9c5137836ea264f24b758305b616063aeb987a (diff)
downloadhostap-4dac84539e126abb42b28d1fb9b8b4e5d6b3635a.zip
hostap-4dac84539e126abb42b28d1fb9b8b4e5d6b3635a.tar.gz
hostap-4dac84539e126abb42b28d1fb9b8b4e5d6b3635a.tar.bz2
wlantest: Implement TKIP replay detection
Diffstat (limited to 'wlantest/tkip.c')
-rw-r--r--wlantest/tkip.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/wlantest/tkip.c b/wlantest/tkip.c
index eb26dfa..2f8d28d 100644
--- a/wlantest/tkip.c
+++ b/wlantest/tkip.c
@@ -392,3 +392,14 @@ u8 * tkip_decrypt(const u8 *tk, const struct ieee80211_hdr *hdr,
*decrypted_len = plain_len - 8;
return plain;
}
+
+
+void tkip_get_pn(u8 *pn, const u8 *data)
+{
+ pn[0] = data[7]; /* PN5 */
+ pn[1] = data[6]; /* PN4 */
+ pn[2] = data[5]; /* PN3 */
+ pn[3] = data[4]; /* PN2 */
+ pn[4] = data[0]; /* PN1 */
+ pn[5] = data[2]; /* PN0 */
+}