aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/wp512.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-24 12:33:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-24 12:33:32 -0700
commit14d4cc08832efb724e58944ba2ac22e2ca3143dc (patch)
treefebca1365a5306d5a44b2481ec41f13f4c2defc2 /crypto/wp512.c
parentMerge tag 'pm+acpi-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm (diff)
parentcrypto: memzero_explicit - make sure to clear out sensitive data (diff)
downloadlinux-dev-14d4cc08832efb724e58944ba2ac22e2ca3143dc.tar.xz
linux-dev-14d4cc08832efb724e58944ba2ac22e2ca3143dc.zip
Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random
Pull /dev/random updates from Ted Ts'o: "This adds a memzero_explicit() call which is guaranteed not to be optimized away by GCC. This is important when we are wiping cryptographically sensitive material" * tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random: crypto: memzero_explicit - make sure to clear out sensitive data random: add and use memzero_explicit() for clearing data
Diffstat (limited to 'crypto/wp512.c')
-rw-r--r--crypto/wp512.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/wp512.c b/crypto/wp512.c
index 180f1d6e03f4..ec64e7762fbb 100644
--- a/crypto/wp512.c
+++ b/crypto/wp512.c
@@ -1102,8 +1102,8 @@ static int wp384_final(struct shash_desc *desc, u8 *out)
u8 D[64];
wp512_final(desc, D);
- memcpy (out, D, WP384_DIGEST_SIZE);
- memset (D, 0, WP512_DIGEST_SIZE);
+ memcpy(out, D, WP384_DIGEST_SIZE);
+ memzero_explicit(D, WP512_DIGEST_SIZE);
return 0;
}
@@ -1113,8 +1113,8 @@ static int wp256_final(struct shash_desc *desc, u8 *out)
u8 D[64];
wp512_final(desc, D);
- memcpy (out, D, WP256_DIGEST_SIZE);
- memset (D, 0, WP512_DIGEST_SIZE);
+ memcpy(out, D, WP256_DIGEST_SIZE);
+ memzero_explicit(D, WP512_DIGEST_SIZE);
return 0;
}