mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00: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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue