[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200807162010.18979-16-andrei.botila@oss.nxp.com>
Date: Fri, 7 Aug 2020 19:20:03 +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>,
Tom Lendacky <thomas.lendacky@....com>,
John Allen <john.allen@....com>
Subject: [PATCH 15/22] crypto: ccp - 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: Tom Lendacky <thomas.lendacky@....com>
Cc: John Allen <john.allen@....com>
Signed-off-by: Andrei Botila <andrei.botila@....com>
---
drivers/crypto/ccp/ccp-crypto-aes-xts.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c
index 6849261ca47d..6a93b54d388a 100644
--- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c
+++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c
@@ -113,6 +113,9 @@ static int ccp_aes_xts_crypt(struct skcipher_request *req,
u32 unit_size;
int ret;
+ if (!req->cryptlen)
+ return 0;
+
if (!ctx->u.aes.key_len)
return -EINVAL;
--
2.17.1
Powered by blists - more mailing lists