aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/blkcipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/blkcipher.c')
-rw-r--r--crypto/blkcipher.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 7a7219266e3c..1e61d1a888b2 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -24,6 +24,8 @@
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/cryptouser.h>
28#include <net/netlink.h>
27 29
28#include "internal.h" 30#include "internal.h"
29 31
@@ -492,6 +494,35 @@ static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
492 return crypto_init_blkcipher_ops_async(tfm); 494 return crypto_init_blkcipher_ops_async(tfm);
493} 495}
494 496
497#ifdef CONFIG_NET
498static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
499{
500 struct crypto_report_blkcipher rblkcipher;
501
502 snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "blkcipher");
503 snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s",
504 alg->cra_blkcipher.geniv ?: "<default>");
505
506 rblkcipher.blocksize = alg->cra_blocksize;
507 rblkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
508 rblkcipher.max_keysize = alg->cra_blkcipher.max_keysize;
509 rblkcipher.ivsize = alg->cra_blkcipher.ivsize;
510
511 NLA_PUT(skb, CRYPTOCFGA_REPORT_BLKCIPHER,
512 sizeof(struct crypto_report_blkcipher), &rblkcipher);
513
514 return 0;
515
516nla_put_failure:
517 return -EMSGSIZE;
518}
519#else
520static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
521{
522 return -ENOSYS;
523}
524#endif
525
495static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg) 526static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg)
496 __attribute__ ((unused)); 527 __attribute__ ((unused));
497static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg) 528static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg)
@@ -511,6 +542,7 @@ const struct crypto_type crypto_blkcipher_type = {
511#ifdef CONFIG_PROC_FS 542#ifdef CONFIG_PROC_FS
512 .show = crypto_blkcipher_show, 543 .show = crypto_blkcipher_show,
513#endif 544#endif
545 .report = crypto_blkcipher_report,
514}; 546};
515EXPORT_SYMBOL_GPL(crypto_blkcipher_type); 547EXPORT_SYMBOL_GPL(crypto_blkcipher_type);
516 548