diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-12 16:14:06 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2008-08-12 16:14:06 +0000 |
commit | f7fbf9fc99797b3d605dc374b4aec198ec959a2f (patch) | |
tree | 8b1c74258c62e3f330e09b1ed394dfb71d296d2a /sys/net80211/ieee80211_proto.c | |
parent | 49e6d0643a8eea171511542ac0f986906275e06e (diff) |
get rid of the map_ptk()/map_gtk() functions, just inline them
which makes things easier to track.
Diffstat (limited to 'sys/net80211/ieee80211_proto.c')
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 14312051a32..5b8e8019b40 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.28 2008/07/27 14:21:15 damien Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.29 2008/08/12 16:14:05 damien Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -386,15 +386,18 @@ ieee80211_node_gtk_rekey(void *arg, struct ieee80211_node *ni) void ieee80211_setkeys(struct ieee80211com *ic) { - u_int8_t gtk[IEEE80211_PMK_LEN]; + struct ieee80211_key *k; u_int8_t kid; /* Swap(GM, GN) */ kid = (ic->ic_def_txkey == 1) ? 2 : 1; - - arc4random_buf(gtk, sizeof(gtk)); - ieee80211_map_gtk(gtk, ic->ic_bss->ni_rsngroupcipher, kid, 1, 0, - &ic->ic_nw_keys[kid]); + k = &ic->ic_nw_keys[kid]; + memset(k, 0, sizeof(*k)); + k->k_id = kid; + k->k_cipher = ic->ic_bss->ni_rsngroupcipher; + k->k_flags = IEEE80211_KEY_GROUP | IEEE80211_KEY_TX; + k->k_len = ieee80211_cipher_keylen(k->k_cipher); + arc4random_buf(k->k_key, k->k_len); ic->ic_rsn_keydonesta = 0; ieee80211_iterate_nodes(ic, ieee80211_node_gtk_rekey, ic); |