summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2020-05-29 07:37:51 +0000
committerstsp <stsp@openbsd.org>2020-05-29 07:37:51 +0000
commitd64dd7a521be1afbc52ea2a3f7ad09ac19babbe7 (patch)
treed335d273ae65dadea3b9729241467af212cf019a
parentIn hostap mode, after completing a new group key handshake with all (diff)
downloadwireguard-openbsd-d64dd7a521be1afbc52ea2a3f7ad09ac19babbe7.tar.xz
wireguard-openbsd-d64dd7a521be1afbc52ea2a3f7ad09ac19babbe7.zip
If no station happens to be associated when ieee80211_setkeys() runs then
complete group key renewal immediately. The old code would not install the new group key unless a station in need of re-keying was present. Tested by Mikolaj Kucharski on bugs@
-rw-r--r--sys/net80211/ieee80211_proto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index e7cee8c9b1a..2027b67c2ff 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.97 2020/05/29 07:34:19 stsp Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.98 2020/05/29 07:37:51 stsp Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -433,6 +433,7 @@ ieee80211_setkeys(struct ieee80211com *ic)
{
struct ieee80211_key *k;
u_int8_t kid;
+ int rekeysta = 0;
/* Swap(GM, GN) */
kid = (ic->ic_def_txkey == 1) ? 2 : 1;
@@ -457,6 +458,9 @@ ieee80211_setkeys(struct ieee80211com *ic)
}
ieee80211_iterate_nodes(ic, ieee80211_node_gtk_rekey, ic);
+ ieee80211_iterate_nodes(ic, ieee80211_count_rekeysta, &rekeysta);
+ if (rekeysta == 0)
+ ieee80211_setkeysdone(ic);
}
/*