diff options
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r-- | crypto/testmgr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index f4ed6d4205e7..1f879adf495a 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -1474,11 +1474,11 @@ static int test_cprng(struct crypto_rng *tfm, struct cprng_testvec *template, | |||
1474 | for (j = 0; j < template[i].loops; j++) { | 1474 | for (j = 0; j < template[i].loops; j++) { |
1475 | err = crypto_rng_get_bytes(tfm, result, | 1475 | err = crypto_rng_get_bytes(tfm, result, |
1476 | template[i].rlen); | 1476 | template[i].rlen); |
1477 | if (err != template[i].rlen) { | 1477 | if (err < 0) { |
1478 | printk(KERN_ERR "alg: cprng: Failed to obtain " | 1478 | printk(KERN_ERR "alg: cprng: Failed to obtain " |
1479 | "the correct amount of random data for " | 1479 | "the correct amount of random data for " |
1480 | "%s (requested %d, got %d)\n", algo, | 1480 | "%s (requested %d)\n", algo, |
1481 | template[i].rlen, err); | 1481 | template[i].rlen); |
1482 | goto out; | 1482 | goto out; |
1483 | } | 1483 | } |
1484 | } | 1484 | } |
@@ -1759,7 +1759,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr, | |||
1759 | ret = crypto_drbg_get_bytes_addtl(drng, | 1759 | ret = crypto_drbg_get_bytes_addtl(drng, |
1760 | buf, test->expectedlen, &addtl); | 1760 | buf, test->expectedlen, &addtl); |
1761 | } | 1761 | } |
1762 | if (ret <= 0) { | 1762 | if (ret < 0) { |
1763 | printk(KERN_ERR "alg: drbg: could not obtain random data for " | 1763 | printk(KERN_ERR "alg: drbg: could not obtain random data for " |
1764 | "driver %s\n", driver); | 1764 | "driver %s\n", driver); |
1765 | goto outbuf; | 1765 | goto outbuf; |
@@ -1774,7 +1774,7 @@ static int drbg_cavs_test(struct drbg_testvec *test, int pr, | |||
1774 | ret = crypto_drbg_get_bytes_addtl(drng, | 1774 | ret = crypto_drbg_get_bytes_addtl(drng, |
1775 | buf, test->expectedlen, &addtl); | 1775 | buf, test->expectedlen, &addtl); |
1776 | } | 1776 | } |
1777 | if (ret <= 0) { | 1777 | if (ret < 0) { |
1778 | printk(KERN_ERR "alg: drbg: could not obtain random data for " | 1778 | printk(KERN_ERR "alg: drbg: could not obtain random data for " |
1779 | "driver %s\n", driver); | 1779 | "driver %s\n", driver); |
1780 | goto outbuf; | 1780 | goto outbuf; |