From 1272be04be0cb803eec87f602edb2e3e6f111aea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:33:34 +0200 Subject: Merging upstream version 2.40. Signed-off-by: Daniel Baumann --- lib/sha1.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/sha1.c') 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 * 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 -- cgit v1.2.3