Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965604AbbFJPoB (ORCPT ); Wed, 10 Jun 2015 11:44:01 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:36193 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933871AbbFJP1v (ORCPT ); Wed, 10 Jun 2015 11:27:51 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Stephan Mueller , Alexander Bergmann , Herbert Xu , Jiri Slaby Subject: [PATCH 3.12 106/111] crypto: testmgr - fix RNG return code enforcement Date: Wed, 10 Jun 2015 17:27:35 +0200 Message-Id: <56005f9a961016e2977e12f1c5bd69601234c77c.1433943052.git.jslaby@suse.cz> X-Mailer: git-send-email 2.4.2 In-Reply-To: <93091169a673f49c2574cddf1ef858cf0704f646.1433943052.git.jslaby@suse.cz> References: <93091169a673f49c2574cddf1ef858cf0704f646.1433943052.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1640 Lines: 47 From: Stephan Mueller 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 19e60e1392d110be03d794e2286dd6cfd779cbe3 upstream. Due to the change to RNGs to always return zero in success case, the invocation of the RNGs in the test manager must be updated as otherwise the RNG self tests are not properly executed any more. Signed-off-by: Stephan Mueller Signed-off-by: Alexander Bergmann Signed-off-by: Herbert Xu Signed-off-by: Jiri Slaby --- crypto/testmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 93e508c39e3b..779a12dcb6a8 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -1460,11 +1460,11 @@ static int test_cprng(struct crypto_rng *tfm, struct cprng_testvec *template, for (j = 0; j < template[i].loops; j++) { err = crypto_rng_get_bytes(tfm, result, template[i].rlen); - if (err != template[i].rlen) { + if (err < 0) { printk(KERN_ERR "alg: cprng: Failed to obtain " "the correct amount of random data for " - "%s (requested %d, got %d)\n", algo, - template[i].rlen, err); + "%s (requested %d)\n", algo, + template[i].rlen); goto out; } } -- 2.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/