[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200807162010.18979-11-andrei.botila@oss.nxp.com>
Date: Fri, 7 Aug 2020 19:19:58 +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>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Ludovic Desroches <ludovic.desroches@...rochip.com>
Subject: [PATCH 10/22] crypto: atmel-aes - 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: Nicolas Ferre <nicolas.ferre@...rochip.com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Ludovic Desroches <ludovic.desroches@...rochip.com>
Signed-off-by: Andrei Botila <andrei.botila@....com>
---
drivers/crypto/atmel-aes.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index a6e14491e080..af789ac73478 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -1107,6 +1107,10 @@ static int atmel_aes_crypt(struct skcipher_request *req, unsigned long mode)
ctx->block_size = CFB64_BLOCK_SIZE;
break;
+ case AES_FLAGS_XTS:
+ if (!req->cryptlen)
+ return 0;
+
default:
ctx->block_size = AES_BLOCK_SIZE;
break;
--
2.17.1
Powered by blists - more mailing lists