Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 5a2bb93f5992 ("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>

authored by

Ovidiu Panait and committed by
Herbert Xu
afffcf3d 9f10bc28

+1 -1
+1 -1
drivers/crypto/sahara.c
··· 1047 1047 1048 1048 memcpy(rctx->context, dev->context_base, rctx->context_size); 1049 1049 1050 - if (req->result) 1050 + if (req->result && rctx->last) 1051 1051 memcpy(req->result, rctx->context, rctx->digest_size); 1052 1052 1053 1053 return 0;