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
parent
1b8b6d74d0
commit
7c2588e590
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue