Commit a7581a01 authored by Herbert Xu's avatar Herbert Xu

crypto: api - Display larval objects properly

Rather than displaying larval objects as real objects, this patch
makes them show up under /proc/crypto as of type larval.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c51b6c81
...@@ -47,7 +47,7 @@ static int c_show(struct seq_file *m, void *p) ...@@ -47,7 +47,7 @@ static int c_show(struct seq_file *m, void *p)
seq_printf(m, "priority : %d\n", alg->cra_priority); seq_printf(m, "priority : %d\n", alg->cra_priority);
seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt)); seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt));
switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) {
case CRYPTO_ALG_TYPE_CIPHER: case CRYPTO_ALG_TYPE_CIPHER:
seq_printf(m, "type : cipher\n"); seq_printf(m, "type : cipher\n");
seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
...@@ -67,7 +67,10 @@ static int c_show(struct seq_file *m, void *p) ...@@ -67,7 +67,10 @@ static int c_show(struct seq_file *m, void *p)
seq_printf(m, "type : compression\n"); seq_printf(m, "type : compression\n");
break; break;
default: default:
if (alg->cra_type && alg->cra_type->show) if (alg->cra_flags & CRYPTO_ALG_LARVAL) {
seq_printf(m, "type : larval\n");
seq_printf(m, "flags : 0x%x\n", alg->cra_flags);
} else if (alg->cra_type && alg->cra_type->show)
alg->cra_type->show(m, alg); alg->cra_type->show(m, alg);
else else
seq_printf(m, "type : unknown\n"); seq_printf(m, "type : unknown\n");
......
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