random: prime last_data value per fips requirements
authorJarod Wilson <jarod@redhat.com>
Tue, 6 Nov 2012 15:42:42 +0000 (10:42 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 8 Nov 2012 12:19:18 +0000 (07:19 -0500)
commitec8f02da9ea500474417d1d31fa3d46a562ab366
tree9a7bb64cdbc436f59345288181768eede207bcf2
parent8eb2ffbf7be94c546a873540ff952140465125e5
random: prime last_data value per fips requirements

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.

CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: "David S. Miller" <davem@davemloft.net>
CC: Matt Mackall <mpm@selenic.com>
CC: linux-crypto@vger.kernel.org
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
drivers/char/random.c