[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200807162010.18979-12-andrei.botila@oss.nxp.com>
Date: Fri, 7 Aug 2020 19:19:59 +0300
From: Andrei Botila <andrei.botila@....nxp.com>
To: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: linux-crypto@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, x86@...nel.org,
linux-arm-kernel@...s.com, Andrei Botila <andrei.botila@....com>,
Jesper Nilsson <jesper.nilsson@...s.com>,
Lars Persson <lars.persson@...s.com>
Subject: [PATCH 11/22] crypto: artpec6 - add check for xts input length equal to zero
From: Andrei Botila <andrei.botila@....com>
Standardize the way input lengths equal to 0 are handled in all skcipher
algorithms. All the algorithms return 0 for input lengths equal to zero.
Cc: Jesper Nilsson <jesper.nilsson@...s.com>
Cc: Lars Persson <lars.persson@...s.com>
Signed-off-by: Andrei Botila <andrei.botila@....com>
---
drivers/crypto/axis/artpec6_crypto.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c
index 1a46eeddf082..243880c97629 100644
--- a/drivers/crypto/axis/artpec6_crypto.c
+++ b/drivers/crypto/axis/artpec6_crypto.c
@@ -1090,6 +1090,9 @@ static int artpec6_crypto_encrypt(struct skcipher_request *req)
void (*complete)(struct crypto_async_request *req);
int ret;
+ if (!req->cryptlen)
+ return 0;
+
req_ctx = skcipher_request_ctx(req);
switch (ctx->crypto_type) {
@@ -1135,6 +1138,9 @@ static int artpec6_crypto_decrypt(struct skcipher_request *req)
struct artpec6_crypto_request_context *req_ctx = NULL;
void (*complete)(struct crypto_async_request *req);
+ if (!req->cryptlen)
+ return 0;
+
req_ctx = skcipher_request_ctx(req);
switch (ctx->crypto_type) {
--
2.17.1
Powered by blists - more mailing lists