All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Neil Horman <nhorman@tuxdriver.com>
Subject: [PATCH v2] crypto: catch base cipher self-test failures in fips mode
Date: Thu, 30 Apr 2009 16:21:56 -0400	[thread overview]
Message-ID: <200904301621.57298.jarod@redhat.com> (raw)
In-Reply-To: <200904290934.32404.jarod@redhat.com>

On Wednesday 29 April 2009 09:34:31 Jarod Wilson wrote:
> On Wednesday 29 April 2009 09:26:46 Herbert Xu wrote:
> > On Wed, Apr 29, 2009 at 09:18:37AM -0400, Jarod Wilson wrote:
> > > On Wednesday 29 April 2009 09:15:07 Herbert Xu wrote:
> > > > On Tue, Apr 28, 2009 at 09:11:51PM -0400, Jarod Wilson wrote:
> > > > >
> > > > > +notest:
> > > > > +	printk(KERN_INFO "alg: No test for %s (%s)\n", alg, driver);
> > > > 
> > > > Can notest ever get here with rc != 0?
> > > 
> > > Nope.
> > 
> > So why do we need to move it?
> 
> Oh. Hrm. Upon looking a bit harder at it, I think the only reason
> would be if we wanted to print out a message claiming success in
> testing ctr(aes).
> 
> There's also a devious ulterior motive for this patch, which is
> to make the cryptodev tree look identical(er) to the Red Hat
> Enterprise Linux 5.x kernel tree w/in alg_test()...

Version 2, streamlined and simplified, RHEL5 be damned.

Signed-off-by: Jarod Wilson <jarod@redhat.com>

---
 crypto/testmgr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 0161cc2..f39c148 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2220,7 +2220,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);
@@ -2229,6 +2230,7 @@ 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);
+test_done:
 	if (fips_enabled && rc)
 		panic("%s: %s alg self test failed in fips mode!\n", driver, alg);
 


-- 
Jarod Wilson
jarod@redhat.com

  reply	other threads:[~2009-04-30 20:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29  1:11 [PATCH] crypto: catch base cipher self-test failures in fips mode Jarod Wilson
2009-04-29  1:11 ` Jarod Wilson
2009-04-29 10:36 ` 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         ` Jarod Wilson [this message]
2009-05-04 11:49           ` [PATCH v2] " 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=200904301621.57298.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 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.