summaryrefslogtreecommitdiffstats
path: root/lib/sha1.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sha1.c')
-rw-r--r--lib/sha1.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sha1.c b/lib/sha1.c
index eedeaa8..3edff12 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -1,4 +1,7 @@
/*
+ * No copyright is claimed. This code is in the public domain; do with
+ * it what you wish.
+ *
* SHA-1 in C by Steve Reid <steve@edmweb.com>
* 100% Public Domain
*
@@ -153,7 +156,15 @@ void ul_SHA1Transform(uint32_t state[5], const unsigned char buffer[64])
state[3] += d;
state[4] += e;
/* Wipe variables */
+#ifdef HAVE_EXPLICIT_BZERO
+ explicit_bzero(&a, sizeof(a));
+ explicit_bzero(&b, sizeof(b));
+ explicit_bzero(&c, sizeof(c));
+ explicit_bzero(&d, sizeof(d));
+ explicit_bzero(&e, sizeof(e));
+#else
a = b = c = d = e = 0;
+#endif
#ifdef UL_SHA1HANDSOFF
memset(block, '\0', sizeof(block));
#endif