summaryrefslogtreecommitdiffstats
path: root/crypto/sha2.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-09-30 09:19:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-02 06:00:12 +0200
commitc27b18eaaf675f2f96b41c1b92fe00ee3940de4d (patch)
tree86391ea9ad037463d35fda3c744bc43329990e6a /crypto/sha2.c
parent4dd5c073c750618054fd4366dcf141770559af46 (diff)
downloadbarebox-c27b18eaaf675f2f96b41c1b92fe00ee3940de4d.tar.gz
barebox-c27b18eaaf675f2f96b41c1b92fe00ee3940de4d.tar.xz
digest: sha: remove no-op "erase" of automatic variables
Some automatic variables are currently cleared as they may contain "sensitive info". Any proper compiler would optimize away these dead stores anyway, so just drop them. Reported-by: clang-analyzer-10 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'crypto/sha2.c')
-rw-r--r--crypto/sha2.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/crypto/sha2.c b/crypto/sha2.c
index 3947a09f41..013f5bb3b2 100644
--- a/crypto/sha2.c
+++ b/crypto/sha2.c
@@ -211,10 +211,6 @@ static void sha256_transform(u32 *state, const u8 *input)
state[0] += a; state[1] += b; state[2] += c; state[3] += d;
state[4] += e; state[5] += f; state[6] += g; state[7] += h;
-
- /* clear any sensitive info... */
- a = b = c = d = e = f = g = h = t1 = t2 = 0;
- memset(W, 0, 64 * sizeof(u32));
}
static int sha224_init(struct digest *desc)