[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180802215118.17752-4-keescook@chromium.org>
Date: Thu, 2 Aug 2018 14:51:12 -0700
From: Kees Cook <keescook@...omium.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Kees Cook <keescook@...omium.org>,
Geliang Tang <geliangtang@...il.com>,
Arnd Bergmann <arnd@...db.de>, Haren Myneni <haren@...ibm.com>,
Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
Tony Luck <tony.luck@...el.com>,
Zhou Wang <wangzhou1@...ilicon.com>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/9] crypto, null: Implement zbufsize()
This implements the worst-case compression size querying interface for
the "null" compression implementation (i.e. no change in size).
Signed-off-by: Kees Cook <keescook@...omium.org>
---
crypto/crypto_null.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/crypto/crypto_null.c b/crypto/crypto_null.c
index 20ff2c746e0b..d1b6107f8443 100644
--- a/crypto/crypto_null.c
+++ b/crypto/crypto_null.c
@@ -39,6 +39,13 @@ static int null_compress(struct crypto_tfm *tfm, const u8 *src,
return 0;
}
+static int null_zbufsize(struct crypto_tfm *tfm, unsigned int slen,
+ unsigned int *dlen)
+{
+ *dlen = slen;
+ return 0;
+}
+
static int null_init(struct shash_desc *desc)
{
return 0;
@@ -146,7 +153,8 @@ static struct crypto_alg null_algs[3] = { {
.cra_module = THIS_MODULE,
.cra_u = { .compress = {
.coa_compress = null_compress,
- .coa_decompress = null_compress } }
+ .coa_decompress = null_compress,
+ .coa_zbufsize = null_zbufsize } }
} };
MODULE_ALIAS_CRYPTO("compress_null");
--
2.17.1
Powered by blists - more mailing lists