mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
crypto: sahara - fix ahash selftest failure
update() calls should not modify the result buffer, so add an additional
check for "rctx->last" to make sure that only the final hash value is
copied into the buffer.
Fixes the following selftest failure:
alg: ahash: sahara-sha256 update() used result buffer on test vector 3,
cfg="init+update+final aligned buffer"
Fixes: 5a2bb93f59
("crypto: sahara - add support for SHA1/256")
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
9f10bc28c0
commit
afffcf3db9
1 changed files with 1 additions and 1 deletions
|
@ -1047,7 +1047,7 @@ static int sahara_sha_process(struct ahash_request *req)
|
|||
|
||||
memcpy(rctx->context, dev->context_base, rctx->context_size);
|
||||
|
||||
if (req->result)
|
||||
if (req->result && rctx->last)
|
||||
memcpy(req->result, rctx->context, rctx->digest_size);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue