Explorar o código

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>
Stephan Mueller %!s(int64=10) %!d(string=hai) anos
pai
achega
2ef4d5c43d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      crypto/algif_rng.c

+ 1 - 1
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;
 }