summaryrefslogtreecommitdiff
path: root/crypto/algif_rng.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2015-03-13 11:44:07 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2015-03-16 21:46:25 +1100
commitcbcdfe774ae5058e96d0f3dcd6401bce4f74e076 (patch)
treec1df0f59f93a2b5dfc214238344b2bfe3a43fdf2 /crypto/algif_rng.c
parent325a37506289e6015e8278e0ef5efa1d956e4cef (diff)
downloadlinux-crypto-cbcdfe774ae5058e96d0f3dcd6401bce4f74e076.tar.gz
linux-crypto-cbcdfe774ae5058e96d0f3dcd6401bce4f74e076.zip
crypto: algif_rng - zeroize buffer with random data
Due to the change to RNGs to always return zero in success case, the RNG interface must zeroize the buffer with the length provided by the caller. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algif_rng.c')
-rw-r--r--crypto/algif_rng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/algif_rng.c b/crypto/algif_rng.c
index 67f612cf..a3461735 100644
--- a/crypto/algif_rng.c
+++ b/crypto/algif_rng.c
@@ -87,7 +87,7 @@ static int rng_recvmsg(struct kiocb *unused, struct socket *sock,
return genlen;
err = memcpy_to_msg(msg, result, len);
- memzero_explicit(result, genlen);
+ memzero_explicit(result, len);
return err ? err : len;
}