[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200807162010.18979-23-andrei.botila@oss.nxp.com>
Date: Fri, 7 Aug 2020 19:20:10 +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>,
Breno Leitão <leitao@...ian.org>,
Nayna Jain <nayna@...ux.ibm.com>,
Paulo Flabiano Smorigo <pfsmorigo@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>
Subject: [PATCH 22/22] crypto: vmx - 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: "Breno Leitão" <leitao@...ian.org>
Cc: Nayna Jain <nayna@...ux.ibm.com>
Cc: Paulo Flabiano Smorigo <pfsmorigo@...il.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Michael Ellerman <mpe@...erman.id.au>
Signed-off-by: Andrei Botila <andrei.botila@....com>
---
drivers/crypto/vmx/aes_xts.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/vmx/aes_xts.c b/drivers/crypto/vmx/aes_xts.c
index 9fee1b1532a4..33107c9e2656 100644
--- a/drivers/crypto/vmx/aes_xts.c
+++ b/drivers/crypto/vmx/aes_xts.c
@@ -84,6 +84,9 @@ static int p8_aes_xts_crypt(struct skcipher_request *req, int enc)
u8 tweak[AES_BLOCK_SIZE];
int ret;
+ if (!req->cryptlen)
+ return 0;
+
if (req->cryptlen < AES_BLOCK_SIZE)
return -EINVAL;
--
2.17.1
Powered by blists - more mailing lists