summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_node.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2008-08-12 18:37:24 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2008-08-12 18:37:24 +0000
commitd97225dfdd26ae62a79c06737a1c575008bdc961 (patch)
tree0ed60d42617ffbdaec2e0d2b8c4d6edf802f4a8f /sys/net80211/ieee80211_node.c
parent6e158471663b5b68a4374b6f40021ecef3dbae1b (diff)
generate a random IGTK in HostAP mode if we're MFP-capable.
Diffstat (limited to 'sys/net80211/ieee80211_node.c')
-rw-r--r--sys/net80211/ieee80211_node.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 39dad39363e..cbae4d9d602 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.39 2008/08/12 16:14:05 damien Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.40 2008/08/12 18:37:23 damien Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -325,6 +325,17 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
arc4random_buf(k->k_key, k->k_len);
(*ic->ic_set_key)(ic, ni, k); /* XXX */
+ if (ic->ic_caps & IEEE80211_C_MFP) {
+ ic->ic_igtk_kid = 4;
+ k = &ic->ic_nw_keys[ic->ic_igtk_kid];
+ memset(k, 0, sizeof(*k));
+ k->k_id = ic->ic_igtk_kid;
+ k->k_cipher = ni->ni_rsngroupmgmtcipher;
+ k->k_flags = IEEE80211_KEY_IGTK | IEEE80211_KEY_TX;
+ k->k_len = 16;
+ arc4random_buf(k->k_key, k->k_len);
+ (*ic->ic_set_key)(ic, ni, k); /* XXX */
+ }
/*
* In HostAP mode, multicast traffic is sent using ic_bss
* as the Tx node, so mark our node as valid so we can send