summaryrefslogtreecommitdiff
path: root/crypto/cts.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
commitc8c48001eb241f335739ef06492ae99b4cd891d6 (patch)
tree14b6f6d514b25ffb16981a2867c6902edf41b685 /crypto/cts.c
parent6de0bdb30d75edcf5f1e3f80da5b65670b9831f1 (diff)
parent8ff8c72485c0d0bbb91377d33bbf016ae0744cd8 (diff)
downloadlinux-crypto-c8c48001eb241f335739ef06492ae99b4cd891d6.tar.gz
linux-crypto-c8c48001eb241f335739ef06492ae99b4cd891d6.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/cts.c')
-rw-r--r--crypto/cts.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/cts.c b/crypto/cts.c
index 042223f8..133f0874 100644
--- a/crypto/cts.c
+++ b/crypto/cts.c
@@ -202,7 +202,8 @@ static int cts_cbc_decrypt(struct crypto_cts_ctx *ctx,
/* 5. Append the tail (BB - Ln) bytes of Xn (tmp) to Cn to create En */
memcpy(s + bsize + lastn, tmp + lastn, bsize - lastn);
/* 6. Decrypt En to create Pn-1 */
- memset(iv, 0, sizeof(iv));
+ memzero_explicit(iv, sizeof(iv));
+
sg_set_buf(&sgsrc[0], s + bsize, bsize);
sg_set_buf(&sgdst[0], d, bsize);
err = crypto_blkcipher_decrypt_iv(&lcldesc, sgdst, sgsrc, bsize);