diff options
author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2023-12-24 10:21:31 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-12-29 11:25:56 +0800 |
commit | d1d6351e37aac14b32a291731d0855996c459d11 (patch) | |
tree | 49e33f6f498c67422658635290a2b85936aab64b /drivers | |
parent | 069579d0291cebda575a823ac1c85f0644e2ed95 (diff) | |
download | linux-stable-d1d6351e37aac14b32a291731d0855996c459d11.tar.gz linux-stable-d1d6351e37aac14b32a291731d0855996c459d11.tar.bz2 linux-stable-d1d6351e37aac14b32a291731d0855996c459d11.zip |
crypto: sahara - handle zero-length aes requests
In case of a zero-length input, exit gracefully from sahara_aes_crypt().
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/sahara.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index 27ed66cb761f..1f78dfe84c51 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -674,6 +674,9 @@ static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode) struct sahara_dev *dev = dev_ptr; int err = 0; + if (!req->cryptlen) + return 0; + if (unlikely(ctx->keylen != AES_KEYSIZE_128)) return sahara_aes_fallback(req, mode); |