summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_crypto_ccmp.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2017-03-23 04:10:11 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2017-03-23 04:10:11 +0000
commit1ce3485cc04e74a61ec9e3553378c1971bdb859d (patch)
treed9de02e01bf97d7f8bde3af8afc36e0ee910a8b6 /sys/net80211/ieee80211_crypto_ccmp.c
parentd01ea33a92b1235261b61f0b0f85e8a44a117a13 (diff)
Use explicit_bzero() to wipe out key material and add some sizes to free().
ok stsp
Diffstat (limited to 'sys/net80211/ieee80211_crypto_ccmp.c')
-rw-r--r--sys/net80211/ieee80211_crypto_ccmp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c
index 7a0ccb53337..acd60a6da2e 100644
--- a/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/sys/net80211/ieee80211_crypto_ccmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.18 2015/11/24 13:45:06 mpi Exp $ */
+/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.19 2017/03/23 04:10:10 tb Exp $ */
/*-
* Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
@@ -66,8 +66,10 @@ ieee80211_ccmp_set_key(struct ieee80211com *ic, struct ieee80211_key *k)
void
ieee80211_ccmp_delete_key(struct ieee80211com *ic, struct ieee80211_key *k)
{
- if (k->k_priv != NULL)
- free(k->k_priv, M_DEVBUF, 0);
+ if (k->k_priv != NULL) {
+ explicit_bzero(k->k_priv, sizeof(struct ieee80211_ccmp_ctx));
+ free(k->k_priv, M_DEVBUF, sizeof(struct ieee80211_ccmp_ctx));
+ }
k->k_priv = NULL;
}