diff options
Diffstat (limited to 'crypto/sha256_generic.c')
-rw-r--r-- | crypto/sha256_generic.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c index 0bb558344699..65e7b76b057f 100644 --- a/crypto/sha256_generic.c +++ b/crypto/sha256_generic.c | |||
@@ -211,10 +211,9 @@ static void sha256_transform(u32 *state, const u8 *input) | |||
211 | 211 | ||
212 | /* clear any sensitive info... */ | 212 | /* clear any sensitive info... */ |
213 | a = b = c = d = e = f = g = h = t1 = t2 = 0; | 213 | a = b = c = d = e = f = g = h = t1 = t2 = 0; |
214 | memset(W, 0, 64 * sizeof(u32)); | 214 | memzero_explicit(W, 64 * sizeof(u32)); |
215 | } | 215 | } |
216 | 216 | ||
217 | |||
218 | static int sha224_init(struct shash_desc *desc) | 217 | static int sha224_init(struct shash_desc *desc) |
219 | { | 218 | { |
220 | struct sha256_state *sctx = shash_desc_ctx(desc); | 219 | struct sha256_state *sctx = shash_desc_ctx(desc); |
@@ -317,7 +316,7 @@ static int sha224_final(struct shash_desc *desc, u8 *hash) | |||
317 | sha256_final(desc, D); | 316 | sha256_final(desc, D); |
318 | 317 | ||
319 | memcpy(hash, D, SHA224_DIGEST_SIZE); | 318 | memcpy(hash, D, SHA224_DIGEST_SIZE); |
320 | memset(D, 0, SHA256_DIGEST_SIZE); | 319 | memzero_explicit(D, SHA256_DIGEST_SIZE); |
321 | 320 | ||
322 | return 0; | 321 | return 0; |
323 | } | 322 | } |