crypto: ccp - Check for caller result area before using it
For a hash operation, the caller doesn't have to supply a result area on every call so don't use it / update it if it hasn't been supplied. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -43,7 +43,9 @@ static int ccp_aes_cmac_complete(struct crypto_async_request *async_req,
|
||||
} else
|
||||
rctx->buf_count = 0;
|
||||
|
||||
memcpy(req->result, rctx->iv, digest_size);
|
||||
/* Update result area if supplied */
|
||||
if (req->result)
|
||||
memcpy(req->result, rctx->iv, digest_size);
|
||||
|
||||
e_free:
|
||||
sg_free_table(&rctx->data_sg);
|
||||
|
Reference in New Issue
Block a user