summaryrefslogtreecommitdiffstats
path: root/lib/sha1.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /lib/sha1.c
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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