summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_crypto.c
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2007-07-24 16:49:16 +0000
committerdamien <damien@openbsd.org>2007-07-24 16:49:16 +0000
commit1d45b9232338c725cd7cfa62d82843fc10fdc9bc (patch)
tree55f6a67f8fd20a37e71d7b1a9ac53e99c777bc54 /sys/net80211/ieee80211_crypto.c
parentmake imsg_create use dynamic buffers. (diff)
downloadwireguard-openbsd-1d45b9232338c725cd7cfa62d82843fc10fdc9bc.tar.xz
wireguard-openbsd-1d45b9232338c725cd7cfa62d82843fc10fdc9bc.zip
add ic_globalcnt to struct ieee80211com:
in an RSNA, each STA must maintain a 256-bit global key counter that must be initialized to a random value (see 8.5.7).
Diffstat (limited to 'sys/net80211/ieee80211_crypto.c')
-rw-r--r--sys/net80211/ieee80211_crypto.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index f7704cb0a2b..82aba54242c 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto.c,v 1.19 2007/07/18 19:47:44 damien Exp $ */
+/* $OpenBSD: ieee80211_crypto.c,v 1.20 2007/07/24 16:49:16 damien Exp $ */
/* $NetBSD: ieee80211_crypto.c,v 1.5 2003/12/14 09:56:53 dyoung Exp $ */
/*-
@@ -107,10 +107,12 @@ void ieee80211_derive_smkid(const u_int8_t *, size_t, const u_int8_t *,
void
ieee80211_crypto_attach(struct ifnet *ifp)
{
- /*
- * Setup crypto support.
- */
+ struct ieee80211com *ic = (void *)ifp;
+
ieee80211_crc_init();
+
+ /* initialize 256-bit global key counter to a random value */
+ get_random_bytes(ic->ic_globalcnt, EAPOL_KEY_NONCE_LEN);
}
void