From: Neil Horman <nhorman@tuxdriver.com>
To: Matt Mackall <mpm@selenic.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
herbert@gondor.apana.org.au, davem@davemloft.net
Subject: Re: [PATCH] crypto: add optional continuous repetition test to entropy store based rngs
Date: Thu, 4 Jun 2009 20:04:56 -0400 [thread overview]
Message-ID: <20090605000456.GA10883@localhost.localdomain> (raw)
In-Reply-To: <1244146450.22069.216.camel@calx>
On Thu, Jun 04, 2009 at 03:14:10PM -0500, Matt Mackall wrote:
> On Thu, 2009-06-04 at 15:50 -0400, Neil Horman wrote:
> > FIPS-140 requires that all random number generators implement continuous self
> > tests in which each extracted block of data is compared against the last block
> > for repetition. The ansi_cprng implements such a test, but it would be nice if
> > the hw rng's did the same thing. Obviously its not something thats always
> > needed, but it seems like it would be a nice feature to have on occasion. I've
> > written the below patch which allows individual entropy stores to be flagged as
> > desiring a continuous test to be run on them as is extracted. By default this
> > option is off, but is enabled in the event that fips mode is selected during
> > bootup.
> >
> > Neil
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> >
> > diff --git a/crypto/internal.h b/crypto/internal.h
> > index fc76e1f..150d389 100644
> > --- a/crypto/internal.h
> > +++ b/crypto/internal.h
> > @@ -26,12 +26,6 @@
> > #include <linux/rwsem.h>
> > #include <linux/slab.h>
> >
> > -#ifdef CONFIG_CRYPTO_FIPS
> > -extern int fips_enabled;
> > -#else
> > -#define fips_enabled 0
> > -#endif
> > -
> > /* Crypto notification events. */
> > enum {
> > CRYPTO_MSG_ALG_REQUEST,
> > diff --git a/drivers/char/random.c b/drivers/char/random.c
> > index 8c74448..fbdfc70 100644
> > --- a/drivers/char/random.c
> > +++ b/drivers/char/random.c
> > @@ -250,6 +250,8 @@
> > #include <asm/irq.h>
> > #include <asm/io.h>
> >
> > +#include <crypto/algapi.h>
> > +
>
> I think we'd rather not make random.c incestuous with crypto/.
>
Not sure what to do about this. The intent is to provide the external reference
to the fips_enabled flag (which is either defined as an extern in or #defined to
0 dependent on CONFIG_CRYPTO_FIPS). I can cut'n'paste the code block from the
include file and put it in here, but that seems like a worse solution to me.
Let me know your thoughts, and I can change this accordingly.
As for the other comments, they all seem good to me, let me know what you want
to do about the above, and I'll respin/repost the patch for you
Thanks!
Neil
next prev parent reply other threads:[~2009-06-05 0:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-04 19:50 [PATCH] crypto: add optional continuous repetition test to entropy store based rngs Neil Horman
2009-06-04 20:14 ` Matt Mackall
2009-06-05 0:04 ` Neil Horman [this message]
2009-06-05 0:30 ` Herbert Xu
2009-06-05 1:48 ` Neil Horman
2009-06-12 14:23 ` Neil Horman
2009-06-12 14:26 ` Herbert Xu
2009-06-12 16:31 ` Matt Mackall
2009-06-12 23:09 ` Herbert Xu
2009-06-18 11:51 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090605000456.GA10883@localhost.localdomain \
--to=nhorman@tuxdriver.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.