From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753608AbbCJPQ3 (ORCPT ); Tue, 10 Mar 2015 11:16:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49382 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376AbbCJPQ1 (ORCPT ); Tue, 10 Mar 2015 11:16:27 -0400 Date: Tue, 10 Mar 2015 16:14:17 +0100 From: Alexander Bergmann To: Herbert Xu Cc: Stephan Mueller , linux-kernel@vger.kernel.org Subject: [PATCH] crypto: DRBG return code handling inside testmgr.c Message-ID: <20150310151417.GU786@surtsey.monkey.lab> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fzZAfzrt3Jhvp+ma" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fzZAfzrt3Jhvp+ma Content-Type: multipart/mixed; boundary="9QtXyXGM8HCrXlir" Content-Disposition: inline --9QtXyXGM8HCrXlir Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Herbert, I just fixed a small DRBG return code issue inside testmgr.c directly=20 related to the RNG changes Stephan submitted. Regards, Alex --=20 Alexander Bergmann , Security Engineer, SUSE Linux GmbH, GF: Felix Imend=F6rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG N=FCrnberg) --9QtXyXGM8HCrXlir Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-crypto-DRBG-return-code-handling-inside-testmgr.c.patch" Content-Transfer-Encoding: quoted-printable =46rom 4348e8ae9361284c9bdd591a4e5988d575daa736 Mon Sep 17 00:00:00 2001 =46rom: Alexander Bergmann 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 --- 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 =3D crypto_drbg_get_bytes_addtl(drng, buf, test->expectedlen, &addtl); } - if (ret <=3D 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 =3D crypto_drbg_get_bytes_addtl(drng, buf, test->expectedlen, &addtl); } - if (ret <=3D 0) { + if (ret < 0) { printk(KERN_ERR "alg: drbg: could not obtain random data for " "driver %s\n", driver); goto outbuf; --=20 1.8.1.4 --9QtXyXGM8HCrXlir-- --fzZAfzrt3Jhvp+ma Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAEBAgAGBQJU/wpJAAoJEN5U6HWf+kiGi/IIAML2ha9BxETZnjK9at3tbGhm OCx2Dym0cTBDHxkKxeJqxtuwxbs5L0ZhWE+bIl72124QV6ZlhxGUWtHriMNzP+m1 2Y98Y/mrITX/s619dOWORwNlHgjcR7NIR5oWaLUZKtxR+j+jN+/C9uvKbKiscDdf hMMSmIdfwZ1RpJJ5pubXGiGgFniEcv9wc7jroccJmiJN+1m+Y7L5b//u37Q+nExx kplQ9tCe2Oc2PIaYm+7Ax06mWAWi7T5YuCihoIk+2Apz1SxBU/JrG7oR2jchFuWy daGuTrxc5A4iXyKI3/WOTkHnPRJBHbiNSk4B+MbYm68l4i9GPAsfiA1dACucsg0= =1rAB -----END PGP SIGNATURE----- --fzZAfzrt3Jhvp+ma--