diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2011-09-27 01:43:24 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-10-21 08:24:05 -0400 |
commit | 3e29c1095a091f606a26c04a6542061c9e5f1d6b (patch) | |
tree | 75c8c096183373fa778286677133fb6e93df89eb /crypto/ablkcipher.c | |
parent | 29ffc87640e2a5bf0ab98bfeed8d6fc78b2d848e (diff) |
crypto: Add userspace report for givcipher type algorithms
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ablkcipher.c')
-rw-r--r-- | crypto/ablkcipher.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 5ea49ad3787e..a816f24f2d52 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c | |||
@@ -457,6 +457,28 @@ static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type, | |||
457 | return 0; | 457 | return 0; |
458 | } | 458 | } |
459 | 459 | ||
460 | static int crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg) | ||
461 | { | ||
462 | struct crypto_report_blkcipher rblkcipher; | ||
463 | |||
464 | snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "givcipher"); | ||
465 | snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s", | ||
466 | alg->cra_ablkcipher.geniv ?: "<built-in>"); | ||
467 | |||
468 | rblkcipher.blocksize = alg->cra_blocksize; | ||
469 | rblkcipher.min_keysize = alg->cra_ablkcipher.min_keysize; | ||
470 | rblkcipher.max_keysize = alg->cra_ablkcipher.max_keysize; | ||
471 | rblkcipher.ivsize = alg->cra_ablkcipher.ivsize; | ||
472 | |||
473 | NLA_PUT(skb, CRYPTOCFGA_REPORT_BLKCIPHER, | ||
474 | sizeof(struct crypto_report_blkcipher), &rblkcipher); | ||
475 | |||
476 | return 0; | ||
477 | |||
478 | nla_put_failure: | ||
479 | return -EMSGSIZE; | ||
480 | } | ||
481 | |||
460 | static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg) | 482 | static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg) |
461 | __attribute__ ((unused)); | 483 | __attribute__ ((unused)); |
462 | static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg) | 484 | static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg) |
@@ -479,6 +501,7 @@ const struct crypto_type crypto_givcipher_type = { | |||
479 | #ifdef CONFIG_PROC_FS | 501 | #ifdef CONFIG_PROC_FS |
480 | .show = crypto_givcipher_show, | 502 | .show = crypto_givcipher_show, |
481 | #endif | 503 | #endif |
504 | .report = crypto_givcipher_report, | ||
482 | }; | 505 | }; |
483 | EXPORT_SYMBOL_GPL(crypto_givcipher_type); | 506 | EXPORT_SYMBOL_GPL(crypto_givcipher_type); |
484 | 507 | ||