mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
crypto: caam - check zero-length input
Check zero-length input, for skcipher algorithm, to solve the extra tests. This is a valid operation, therefore the API will return no error. Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> Reviewed-by: Horia Geanta <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
fcd23ed57c
commit
31bb2f0da1
@@ -1499,6 +1499,9 @@ static int skcipher_encrypt(struct skcipher_request *req)
|
||||
struct caam_request *caam_req = skcipher_request_ctx(req);
|
||||
int ret;
|
||||
|
||||
if (!req->cryptlen)
|
||||
return 0;
|
||||
|
||||
/* allocate extended descriptor */
|
||||
edesc = skcipher_edesc_alloc(req);
|
||||
if (IS_ERR(edesc))
|
||||
@@ -1527,6 +1530,8 @@ static int skcipher_decrypt(struct skcipher_request *req)
|
||||
struct caam_request *caam_req = skcipher_request_ctx(req);
|
||||
int ret;
|
||||
|
||||
if (!req->cryptlen)
|
||||
return 0;
|
||||
/* allocate extended descriptor */
|
||||
edesc = skcipher_edesc_alloc(req);
|
||||
if (IS_ERR(edesc))
|
||||
|
||||
Reference in New Issue
Block a user