diff options
author | Giovanni Cabiddu <giovanni.cabiddu@intel.com> | 2016-10-21 13:19:47 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-10-25 11:08:30 +0800 |
commit | b4ca2d19f510ba9c55fee2a653a6692ed91f06ac (patch) | |
tree | 0ed5bbc01eb293ce898b83193caa6b534955dc74 /crypto/crypto_user.c | |
parent | 949b2a98b034e395851bad3bdb45056bd0c5d94b (diff) | |
download | linux-crypto-b4ca2d19f510ba9c55fee2a653a6692ed91f06ac.tar.gz linux-crypto-b4ca2d19f510ba9c55fee2a653a6692ed91f06ac.zip |
crypto: acomp - add asynchronous compression api
Add acomp, an asynchronous compression api that uses scatterlist
buffers.
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r-- | crypto/crypto_user.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 1c570548..a90404a0 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -112,6 +112,21 @@ nla_put_failure: return -EMSGSIZE; } +static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg) +{ + struct crypto_report_acomp racomp; + + strncpy(racomp.type, "acomp", sizeof(racomp.type)); + + if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP, + sizeof(struct crypto_report_acomp), &racomp)) + goto nla_put_failure; + return 0; + +nla_put_failure: + return -EMSGSIZE; +} + static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_report_akcipher rakcipher; @@ -186,7 +201,11 @@ static int crypto_report_one(struct crypto_alg *alg, goto nla_put_failure; break; + case CRYPTO_ALG_TYPE_ACOMPRESS: + if (crypto_report_acomp(skb, alg)) + goto nla_put_failure; + break; case CRYPTO_ALG_TYPE_AKCIPHER: if (crypto_report_akcipher(skb, alg)) goto nla_put_failure; |