diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2011-09-27 07:48:48 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-12-21 02:01:50 +0100 |
commit | 064ee89abd02d6c39d77596a6babcb5fe0b49079 (patch) | |
tree | 084c01198b2801ca0d8780b9dcf30d78da08d4b9 /crypto | |
parent | a727f256e33c68022c62e68f7184e4d1a1d8e57b (diff) |
crypto: Add userspace report for compress type algorithms
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 540b97c1dd9ee68112269be322d901f1edc1a282)
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/crypto_user.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 52459ae711a9..748990fa3c53 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -89,6 +89,21 @@ nla_put_failure: return -EMSGSIZE; } +static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) +{ + struct crypto_report_comp rcomp; + + snprintf(rcomp.type, CRYPTO_MAX_ALG_NAME, "%s", "compression"); + + NLA_PUT(skb, CRYPTOCFGA_REPORT_COMPRESS, + sizeof(struct crypto_report_comp), &rcomp); + + return 0; + +nla_put_failure: + return -EMSGSIZE; +} + static int crypto_report_one(struct crypto_alg *alg, struct crypto_user_alg *ualg, struct sk_buff *skb) { @@ -127,6 +142,11 @@ static int crypto_report_one(struct crypto_alg *alg, goto nla_put_failure; break; + case CRYPTO_ALG_TYPE_COMPRESS: + if (crypto_report_comp(skb, alg)) + goto nla_put_failure; + + break; } out: |