aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/ccmp.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-11 18:21:11 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-11 18:21:11 (GMT)
commit2edd5c23adf04bb7e1da61ece82fe8b1eb948b44 (patch)
treec81e87f6e928a20c5bd5f8e32cff642e771b8345 /wlantest/ccmp.c
parent07d0a5be453866085a71c8fcde4e2a4e87289780 (diff)
downloadhostap-2edd5c23adf04bb7e1da61ece82fe8b1eb948b44.zip
hostap-2edd5c23adf04bb7e1da61ece82fe8b1eb948b44.tar.gz
hostap-2edd5c23adf04bb7e1da61ece82fe8b1eb948b44.tar.bz2
wlantest: Add replay detection for CCMP
Diffstat (limited to 'wlantest/ccmp.c')
-rw-r--r--wlantest/ccmp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/wlantest/ccmp.c b/wlantest/ccmp.c
index c6da41a..7bb2d2e 100644
--- a/wlantest/ccmp.c
+++ b/wlantest/ccmp.c
@@ -211,3 +211,14 @@ u8 * ccmp_decrypt(const u8 *tk, const struct ieee80211_hdr *hdr,
*decrypted_len = mlen;
return plain;
}
+
+
+void ccmp_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[1]; /* PN1 */
+ pn[5] = data[0]; /* PN0 */
+}