On Tue, Nov 06, 2012 at 10:42:42AM -0500, Jarod Wilson wrote:
The value stored in last_data must be primed for FIPS 140-2 purposes. Upon
first use, either on system startup or after an RNDCLEARPOOL ioctl, we
need to take an initial random sample, store it internally in last_data,
then pass along the value after that to the requester, so that consistency
checks aren't being run against stale and possibly known data.
v2: streamline code flow a bit, eliminating extra loop and spinlock in the
case where we need to prime, and account for the extra primer bits.
v3: extract_buf() can't be called with spinlock already held, so bring
back some extra lock/unlock calls.
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: "David S. Miller" <davem@davemloft.net>
CC: Neil Horman <nhorman@tuxdriver.com>
CC: Matt Mackall <redacted>
CC: linux-crypto@vger.kernel.org
Signed-off-by: Jarod Wilson <redacted>
Thanks, applied to the /dev/random git tree.
- Ted