All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: DRBG return code handling inside testmgr.c
@ 2015-03-10 15:14 Alexander Bergmann
  2015-03-10 16:11 ` Stephan Mueller
  2015-03-10 21:48 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Bergmann @ 2015-03-10 15:14 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Stephan Mueller, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 350 bytes --]

Hi Herbert,

I just fixed a small DRBG return code issue inside testmgr.c directly 
related to the RNG changes Stephan submitted.


Regards,
Alex

-- 
Alexander Bergmann <abergmann@suse.com>, Security Engineer,
SUSE Linux GmbH,
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton, HRB 21284 (AG Nürnberg)

[-- Attachment #1.2: 0001-crypto-DRBG-return-code-handling-inside-testmgr.c.patch --]
[-- Type: text/x-patch, Size: 1356 bytes --]

From 4348e8ae9361284c9bdd591a4e5988d575daa736 Mon Sep 17 00:00:00 2001
From: Alexander Bergmann <abergmann@suse.com>
Date: Tue, 10 Mar 2015 16:05:22 +0100
Subject: [PATCH] crypto: DRBG return code handling inside testmgr.c

This is a follow-up fix for the "RNGs must return 0 in success case"
changes. The drbg_cavs_test function has to handle the DRBG return codes
correctly as 0 is not an error anymore.

Signed-off-by: Alexander Bergmann <abergmann@suse.com>
---
 crypto/testmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index f4ed6d4..01b6967 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1759,7 +1759,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr,
 		ret = crypto_drbg_get_bytes_addtl(drng,
 			buf, test->expectedlen, &addtl);
 	}
-	if (ret <= 0) {
+	if (ret < 0) {
 		printk(KERN_ERR "alg: drbg: could not obtain random data for "
 		       "driver %s\n", driver);
 		goto outbuf;
@@ -1774,7 +1774,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr,
 		ret = crypto_drbg_get_bytes_addtl(drng,
 			buf, test->expectedlen, &addtl);
 	}
-	if (ret <= 0) {
+	if (ret < 0) {
 		printk(KERN_ERR "alg: drbg: could not obtain random data for "
 		       "driver %s\n", driver);
 		goto outbuf;
-- 
1.8.1.4


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: DRBG return code handling inside testmgr.c
  2015-03-10 15:14 [PATCH] crypto: DRBG return code handling inside testmgr.c Alexander Bergmann
@ 2015-03-10 16:11 ` Stephan Mueller
  2015-03-10 21:48 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Stephan Mueller @ 2015-03-10 16:11 UTC (permalink / raw)
  To: Alexander Bergmann; +Cc: Herbert Xu, linux-kernel

Am Dienstag, 10. März 2015, 16:14:17 schrieb Alexander Bergmann:

Hi Alexander,

> Hi Herbert,
> 
> I just fixed a small DRBG return code issue inside testmgr.c directly
> related to the RNG changes Stephan submitted.

Can you please resend it as an inline patch and copy linux-crypto too?

Also, there is a similar error in test_cprng -- may I ask you to fix that one 
too?
> 
> 
> Regards,
> Alex


-- 
Ciao
Stephan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: DRBG return code handling inside testmgr.c
  2015-03-10 15:14 [PATCH] crypto: DRBG return code handling inside testmgr.c Alexander Bergmann
  2015-03-10 16:11 ` Stephan Mueller
@ 2015-03-10 21:48 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2015-03-10 21:48 UTC (permalink / raw)
  To: Alexander Bergmann; +Cc: Stephan Mueller, linux-kernel

On Tue, Mar 10, 2015 at 04:14:17PM +0100, Alexander Bergmann wrote:
> Hi Herbert,
> 
> I just fixed a small DRBG return code issue inside testmgr.c directly 
> related to the RNG changes Stephan submitted.

Thanks Alex.  Could you resend this via linux-crypto@vger.kernel.org
so that patchworks can pick it up?

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-10 21:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 15:14 [PATCH] crypto: DRBG return code handling inside testmgr.c Alexander Bergmann
2015-03-10 16:11 ` Stephan Mueller
2015-03-10 21:48 ` Herbert Xu

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.