From: Stephan Mueller Date: Tue, 10 Mar 2015 16:00:36 +0000 (+0100) Subject: crypto: testmgr - fix RNG return code enforcement X-Git-Tag: v3.12.44~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56005f9a961016e2977e12f1c5bd69601234c77c;p=thirdparty%2Fkernel%2Fstable.git crypto: testmgr - fix RNG return code enforcement 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 --- diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 93e508c39e3be..779a12dcb6a84 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; } }