From: Jarod Wilson <jarod@redhat.com>
To: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>,
Neil Horman <nhorman@tuxdriver.com>
Subject: [PATCH] crypto: catch base cipher self-test failures in fips mode
Date: Tue, 28 Apr 2009 21:11:51 -0400 [thread overview]
Message-ID: <200904282111.52074.jarod@redhat.com> (raw)
I think this might have already been posted by Neil Horman, and
we already have it in the Red Hat Enterprise Linux 5.x kernels,
but in fips mode, we need to panic on the base cipher self-tests
failing as well as the later tests.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
crypto/testmgr.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 40c1078..5a50416 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2109,7 +2109,7 @@ static int alg_find_test(const char *alg)
int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
{
int i;
- int rc;
+ int rc = 0;
if ((type & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_CIPHER) {
char nalg[CRYPTO_MAX_ALG_NAME];
@@ -2122,7 +2122,8 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
if (i < 0)
goto notest;
- return alg_test_cipher(alg_test_descs + i, driver, type, mask);
+ rc = alg_test_cipher(alg_test_descs + i, driver, type, mask);
+ goto test_done;
}
i = alg_find_test(alg);
@@ -2131,14 +2132,13 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
rc = alg_test_descs[i].test(alg_test_descs + i, driver,
type, mask);
+ goto test_done;
+notest:
+ printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver);
+test_done:
if (fips_enabled && rc)
panic("%s: %s alg self test failed in fips mode!\n", driver, alg);
-
return rc;
-
-notest:
- printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver);
- return 0;
}
EXPORT_SYMBOL_GPL(alg_test);
--
Jarod Wilson
jarod@redhat.com
next reply other threads:[~2009-04-29 1:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-29 1:11 Jarod Wilson [this message]
2009-04-29 10:36 ` [PATCH] crypto: catch base cipher self-test failures in fips mode Neil Horman
2009-04-29 12:38 ` Jarod Wilson
2009-04-29 13:15 ` Herbert Xu
2009-04-29 13:18 ` Jarod Wilson
2009-04-29 13:26 ` Herbert Xu
2009-04-29 13:34 ` Jarod Wilson
2009-04-30 20:21 ` [PATCH v2] " Jarod Wilson
2009-05-04 11:49 ` 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=200904282111.52074.jarod@redhat.com \
--to=jarod@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox