1
0
Fork 0

crypto: dcp - check zero-length input

In case of zero-length input for ablkcipher algorithms, IV copying
accesses invalid memory - due to (last_out_len-AES_BLOCK_SIZE)
turning into a big unsigned offset for last_out_len = 0U.

Since zero-length input is allowed for ablkcipher / skcipher algorithms,
make this case a no-op by returning immediately.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Horia Geantă 2019-10-16 17:09:14 +03:00 committed by Dong Aisheng
parent 1b8b6d74d0
commit 7c2588e590
1 changed files with 3 additions and 0 deletions

View File

@ -298,6 +298,9 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
int init = 0;
bool limit_hit = false;
if (!req->nbytes)
return 0;
actx->fill = 0;
/* Copy the key from the temporary location. */