Commit 56005f9a authored by Stephan Mueller's avatar Stephan Mueller Committed by Jiri Slaby

crypto: testmgr - fix RNG return code enforcement

commit 19e60e13 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: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarAlexander Bergmann <abergmann@suse.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent f60b0fa8
...@@ -1460,11 +1460,11 @@ static int test_cprng(struct crypto_rng *tfm, struct cprng_testvec *template, ...@@ -1460,11 +1460,11 @@ static int test_cprng(struct crypto_rng *tfm, struct cprng_testvec *template,
for (j = 0; j < template[i].loops; j++) { for (j = 0; j < template[i].loops; j++) {
err = crypto_rng_get_bytes(tfm, result, err = crypto_rng_get_bytes(tfm, result,
template[i].rlen); template[i].rlen);
if (err != template[i].rlen) { if (err < 0) {
printk(KERN_ERR "alg: cprng: Failed to obtain " printk(KERN_ERR "alg: cprng: Failed to obtain "
"the correct amount of random data for " "the correct amount of random data for "
"%s (requested %d, got %d)\n", algo, "%s (requested %d)\n", algo,
template[i].rlen, err); template[i].rlen);
goto out; goto out;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment