mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Stephan Mueller <smueller@chronox.de>
Cc: simo@redhat.com, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] crypto: drbg - update FIPS CTR self-checks to aes256
Date: Sun, 29 Oct 2023 22:48:21 +0200	[thread overview]
Message-ID: <20231029204823.663930-2-dimitri.ledkov@canonical.com> (raw)
In-Reply-To: <20231029204823.663930-1-dimitri.ledkov@canonical.com>

When originally drbg was introduced FIPS self-checks for all types but
CTR were using the most preferred parameters for each type of
DRBG. Update CTR self-check to use aes256.

Fixes: 541af946fe ("crypto: drbg - SP800-90A Deterministic Random Bit Generator")
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 crypto/drbg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/crypto/drbg.c b/crypto/drbg.c
index 2cce18dcfc..b120e2866b 100644
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@ -1478,8 +1478,8 @@ static int drbg_generate(struct drbg_state *drbg,
 			err = alg_test("drbg_pr_hmac_sha256",
 				       "drbg_pr_hmac_sha256", 0, 0);
 		else if (drbg->core->flags & DRBG_CTR)
-			err = alg_test("drbg_pr_ctr_aes128",
-				       "drbg_pr_ctr_aes128", 0, 0);
+			err = alg_test("drbg_pr_ctr_aes256",
+				       "drbg_pr_ctr_aes256", 0, 0);
 		else
 			err = alg_test("drbg_pr_sha256",
 				       "drbg_pr_sha256", 0, 0);
@@ -2017,7 +2017,7 @@ static inline int __init drbg_healthcheck_sanity(void)
 		return 0;
 
 #ifdef CONFIG_CRYPTO_DRBG_CTR
-	drbg_convert_tfm_core("drbg_nopr_ctr_aes128", &coreref, &pr);
+	drbg_convert_tfm_core("drbg_nopr_ctr_aes256", &coreref, &pr);
 #endif
 #ifdef CONFIG_CRYPTO_DRBG_HASH
 	drbg_convert_tfm_core("drbg_nopr_sha256", &coreref, &pr);
-- 
2.34.1


  reply	other threads:[~2023-10-29 20:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 20:48 [PATCH 1/4] crypto: drbg - ensure most preferred type is FIPS health checked Dimitri John Ledkov
2023-10-29 20:48 ` Dimitri John Ledkov [this message]
2023-10-30 10:23   ` [PATCH 2/4] crypto: drbg - update FIPS CTR self-checks to aes256 Stephan Mueller
2023-10-30 10:30     ` Dimitri John Ledkov
2023-10-30 10:35       ` Stephan Mueller
2023-10-29 20:48 ` [PATCH 3/4] crypto: drbg - ensure drbg hmac sha512 is used in FIPS selftests Dimitri John Ledkov
2023-10-30 10:25   ` Stephan Mueller
2023-10-29 20:48 ` [PATCH 4/4] crypto: drbg - Remove SHA1 from drbg Dimitri John Ledkov
2023-10-30 11:20   ` Stephan Mueller
2023-10-30 10:19 ` [PATCH 1/4] crypto: drbg - ensure most preferred type is FIPS health checked Stephan Mueller
2023-10-30 12:05 ` [PATCH v2 0/4] drbg small fixes Dimitri John Ledkov
2023-10-30 12:05   ` [PATCH v2 1/4] crypto: drbg - ensure most preferred type is FIPS health checked Dimitri John Ledkov
2023-10-30 12:05   ` [PATCH v2 2/4] crypto: drbg - update FIPS CTR self-checks to aes256 Dimitri John Ledkov
2023-10-30 12:05   ` [PATCH v2 3/4] crypto: drbg - ensure drbg hmac sha512 is used in FIPS selftests Dimitri John Ledkov
2023-10-30 12:05   ` [PATCH v2 4/4] crypto: drbg - Remove SHA1 from drbg Dimitri John Ledkov
2023-11-17 11:23   ` [PATCH v2 0/4] drbg small fixes 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=20231029204823.663930-2-dimitri.ledkov@canonical.com \
    --to=dimitri.ledkov@canonical.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simo@redhat.com \
    --cc=smueller@chronox.de \
    /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

all inboxes | Powered by JetHome®