]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: drbg - fix failure of generating multiple of 2**16 bytes
authorStephan Mueller <smueller@chronox.de>
Thu, 31 Jul 2014 19:47:33 +0000 (21:47 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Aug 2014 14:36:14 +0000 (22:36 +0800)
commite2cb296d5c92c78a127a86ad1732144d0c29441c
treeeb6d591256bcfaec0febc7edcf603566544a1210
parentf5dc99eab825f6819c590590ebdb9dc5e89ce9d0
crypto: drbg - fix failure of generating multiple of 2**16 bytes

The function drbg_generate_long slices the request into 2**16 byte
or smaller chunks. However, the loop, however invokes the random number
generation function with zero bytes when the request size is a multiple
of 2**16 bytes. The fix prevents zero bytes requests.

Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/drbg.c