Skip to content

Commit

Permalink
crypto: testmgr - Print akcipher algorithm name
Browse files Browse the repository at this point in the history
When an akcipher test fails, we don't know which algorithm failed
because the name is not printed.  This patch fixes this.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jul 19, 2016
1 parent aa6416e commit 15226e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2034,15 +2034,17 @@ static int test_akcipher_one(struct crypto_akcipher *tfm,
static int test_akcipher(struct crypto_akcipher *tfm, const char *alg,
struct akcipher_testvec *vecs, unsigned int tcount)
{
const char *algo =
crypto_tfm_alg_driver_name(crypto_akcipher_tfm(tfm));
int ret, i;

for (i = 0; i < tcount; i++) {
ret = test_akcipher_one(tfm, vecs++);
if (!ret)
continue;

pr_err("alg: akcipher: test failed on vector %d, err=%d\n",
i + 1, ret);
pr_err("alg: akcipher: test %d failed for %s, err=%d\n",
i + 1, algo, ret);
return ret;
}
return 0;
Expand Down

0 comments on commit 15226e4

Please sign in to comment.