Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH 5/8] crypto: drbg - Add stdrng alias and increase priority
Date: Wed, 03 Jun 2015 08:59:13 +0200	[thread overview]
Message-ID: <1663398.CPqnxUufLz@tauon> (raw)
In-Reply-To: <E1Z02US-0001Gy-Hd@gondolin.me.apana.org.au>

Am Mittwoch, 3. Juni 2015, 14:49:28 schrieb Herbert Xu:

Hi Herbert,

>This patch adds the stdrng module alias and increases the priority
>to ensure that it is loaded in preference to other RNGs.
>
>Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>---
>
> crypto/drbg.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/crypto/drbg.c b/crypto/drbg.c
>index 9284348..04836b4 100644
>--- a/crypto/drbg.c
>+++ b/crypto/drbg.c
>@@ -1876,7 +1876,7 @@ static inline void __init drbg_fill_array(struct
>rng_alg *alg, const struct drbg_core *core, int pr)
> {
> 	int pos = 0;
>-	static int priority = 100;
>+	static int priority = 200;

Considering the patch 8/8 which removes krng, wouldn't it make sense to remove 
the following code from the DRBG:

        /*
         * If FIPS mode enabled, the selected DRBG shall have the
         * highest cra_priority over other stdrng instances to ensure
         * it is selected.
         */
        if (fips_enabled)
                alg->base.cra_priority += 200;

That code was added to get a higher prio than the krng in FIPS mode. As this 
is not needed any more (krng is gone), I would say it is safe to remove this 
code too.

>
> 	memcpy(alg->base.cra_name, "stdrng", 6);
> 	if (pr) {
>@@ -1965,3 +1965,4 @@ MODULE_DESCRIPTION("NIST SP800-90A Deterministic Random
>Bit Generator (DRBG) " CRYPTO_DRBG_HASH_STRING
> 		   CRYPTO_DRBG_HMAC_STRING
> 		   CRYPTO_DRBG_CTR_STRING);
>+MODULE_ALIAS_CRYPTO("stdrng");


Ciao
Stephan

  reply	other threads:[~2015-06-03  6:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03  6:46 [PATCH 0/8] crypto: Avoid using RNG in interrupt context Herbert Xu
2015-06-03  6:49 ` [PATCH 1/8] crypto: chainiv - Move IV seeding into init function Herbert Xu
2015-06-03  6:49 ` [PATCH 2/8] crypto: echainiv " Herbert Xu
2015-06-03  6:49 ` [PATCH 3/8] crypto: eseqiv " Herbert Xu
2015-06-03  6:49 ` [PATCH 4/8] crypto: seqiv " Herbert Xu
2015-06-03  6:49 ` [PATCH 5/8] crypto: drbg - Add stdrng alias and increase priority Herbert Xu
2015-06-03  6:59   ` Stephan Mueller [this message]
2015-06-03  7:01     ` Herbert Xu
2015-06-03  7:08       ` Stephan Mueller
2015-06-03  6:49 ` [PATCH 6/8] crypto: echainiv - Set Kconfig default to m Herbert Xu
2015-06-03  6:49 ` [PATCH 7/8] crypto: rng - Make DRBG the default RNG Herbert Xu
2015-06-03  6:49 ` [PATCH 8/8] crypto: rng - Remove krng 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=1663398.CPqnxUufLz@tauon \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox