DragonFlyBSD Kernel Audit
DF-0966 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/crypto/twofish/twofish.c b/sys/crypto/twofish/twofish.c
--- a/sys/crypto/twofish/twofish.c
+++ b/sys/crypto/twofish/twofish.c
@@ -31,6 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/endian.h>
+#include <sys/systm.h>
 
 #include <crypto/twofish/twofish.h>
 
@@ -449,6 +450,9 @@
     }
 
     gen_mk_tab(ctx, s_key);
+
+    explicit_bzero(me_key, sizeof(me_key));
+    explicit_bzero(mo_key, sizeof(mo_key));
 }
 
 /* encrypt a block of text  */