From: Jarod Wilson <jarod@redhat.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au,
davem@davemloft.net
Subject: Re: [PATCH 0/3] enhance RNG api with flags to allow for different operational modes
Date: Wed, 16 Sep 2009 16:56:12 -0400 [thread overview]
Message-ID: <4AB150EC.8070303@redhat.com> (raw)
In-Reply-To: <20090916160456.GC11163@hmsreliant.think-freely.org>
On 09/16/2009 12:04 PM, Neil Horman wrote:
> Hey all-
> Ok, so I've got a story behind this one. It was recently called to my
> attention that the ansi cprng is missing an aspect of its compliance requrements
> for FIPS-140. Specifically, its missing a behavior in its continuous test.
> When the CPRNG produces random blocks, the firrst block that it produces must
> never be returned to the user. Instead it must be saved and a second block must
> be generated so that it can be compared to the first block before being returned
> to the user.
>
> I recently posted a patch to do this for the hardware RNG. Its fine to
> do this there, since there are no expectations of a predictable result in that
> RNG. The CPRNG however, provides a predictable random sequence for a given
> input seed key and iteration. The above requirement messes with that
> predictability however because it changes which block is returned on the zeroth
> iteration to the user. Some test vectors expect this, some do not.
>
> So the question is, how do I make this RNG fips compliant without
> breaking some subset of users out there that rely on the predictability of the
> CPRNG? The solution I've come up with is a dynamic flag. This patch series
> adds two api calls to the crypto RNG api rng_set_flags and rng_get_flags, which
> set flags with global meaning on instances of an rng. A given RNG can opt to
> set the registered agorithm methods for these api calls or not. In the event
> they don't a default handler is set for each that returns EOPNOTSUPPORT.
>
> Using this new mechanism I've implemented these calls in ansi_cprng so
> that setting the TEST_MODE flag disables the continuous check, allowing for the
> zeroth block to get returned to the user, which lets us pass most of the
> supplied test vectors (most notably the NIST provided vectors).
Neil and I discussed this whole mess off-list, and I'm in agreement that
this is the cleanest solution to the problem, despite the relative
complexity it adds to the base rng code.
Will reply to each part individually for tracking purposes, but ACK for
all three parts.
--
Jarod Wilson
jarod@redhat.com
next prev parent reply other threads:[~2009-09-16 20:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 16:04 [PATCH 0/3] enhance RNG api with flags to allow for different operational modes Neil Horman
2009-09-16 16:11 ` [PATCH 1/3] add RNG api calls to set common flags Neil Horman
2009-09-16 20:56 ` Jarod Wilson
2009-09-16 16:13 ` [PATCH 2/3] augment the testmgr code to set TEST_MODE flag on all rng instances Neil Horman
2009-09-16 20:57 ` Jarod Wilson
2009-09-16 16:25 ` [PATCH 3/3] augment CPRNG to correctly implement continuous test for FIPS, and support TEST_MODE flags Neil Horman
2009-09-16 20:57 ` Jarod Wilson
2009-09-16 20:56 ` Jarod Wilson [this message]
2009-09-17 3:37 ` [PATCH 0/3] enhance RNG api with flags to allow for different operational modes Herbert Xu
2009-09-17 12:28 ` Jarod Wilson
2009-09-17 12:43 ` Neil Horman
2009-09-17 15:39 ` Herbert Xu
2009-09-17 17:08 ` Neil Horman
2009-09-17 20:16 ` Herbert Xu
2009-09-17 20:18 ` Jarod Wilson
2009-09-17 20:23 ` Herbert Xu
2009-09-18 18:32 ` [PATCH 0/1] enhance RNG api with flags to allow for different operational modes (v2) Neil Horman
2009-09-18 18:34 ` [PATCH 1/1] add fips(ansi_cprng) (v2) Neil Horman
2009-09-19 1:12 ` Jarod Wilson
2009-10-19 2:56 ` 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=4AB150EC.8070303@redhat.com \
--to=jarod@redhat.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=nhorman@tuxdriver.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.