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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:46:12 +0000 (16:46 +0200)
commitf03136a54b7992e82f85e37d6894d9163c72c9f9
tree2243cdd020afff49c3a9f58e2927c7fa9be86355
parent9dc84ac72e303d209eeaf3999d304dae3bb21823
crypto: inside-secure - move the digest to the request context

[ Upstream commit b869648c060fbb00bf6578d13cbe83e6f85914bc ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/inside-secure/safexcel_hash.c