lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Apr 2009 16:21:56 -0400
From:	Jarod Wilson <jarod@...hat.com>
To:	Herbert Xu <herbert@...dor.apana.org.au>
Cc:	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
	Neil Horman <nhorman@...driver.com>
Subject: [PATCH v2] crypto: catch base cipher self-test failures in fips mode

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@...hat.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@...hat.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ