mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-06 05:44:20 +08:00
crypto: sahara - handle zero-length aes requests
In case of a zero-length input, exit gracefully from sahara_aes_crypt().
Fixes: 5de8875281
("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>
This commit is contained in:
parent
069579d029
commit
d1d6351e37
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user