Skip to content

Commit

Permalink
crypto: algif_rng - zeroize buffer with random data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
smuellerDD authored and herbertx committed Mar 16, 2015
1 parent 5986ac4 commit 2ef4d5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/algif_rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2ef4d5c

Please sign in to comment.