OSDN Git Service

crypto: inside-secure - move the digest to the request context
authorAntoine Tenart <antoine.tenart@bootlin.com>
Mon, 19 Mar 2018 08:21:13 +0000 (09:21 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Mar 2018 17:32:42 +0000 (01:32 +0800)
commitb869648c060fbb00bf6578d13cbe83e6f85914bc
tree56c77e43aee7dd8737cb9b910f39bf12b18aac74
parente9acf05255cbf72dc32169957d2895cbfd12c7e1
crypto: inside-secure - move the digest to the request context

This patches moves the digest information from the transformation
context to the request context. This fixes cases where HMAC init
functions were called and override the digest value for a short period
of time, as the HMAC init functions call the SHA init one which reset
the value. This lead to a small percentage of HMAC being incorrectly
computed under heavy load.

Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver")
Suggested-by: Ofer Heifetz <oferh@marvell.com>
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
[Ofer here did all the work, from seeing the issue to understanding the
root cause. I only made the patch.]
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_hash.c