summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net80211/ieee80211_crypto.c10
-rw-r--r--sys/net80211/ieee80211_var.h3
2 files changed, 8 insertions, 5 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
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index d7c1b61c3b3..e1738ef93ec 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_var.h,v 1.30 2007/07/18 18:10:31 damien Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.31 2007/07/24 16:49:16 damien Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
@@ -232,6 +232,7 @@ struct ieee80211com {
*/
struct ieee80211_edca_ac_params ic_edca_ac[EDCA_NUM_AC];
u_int ic_edca_updtcount;
+ u_int8_t ic_globalcnt[EAPOL_KEY_NONCE_LEN];
u_int8_t *ic_tim_bitmap;
u_int ic_tim_len;