summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccree
diff options
context:
space:
mode:
authorGilad Ben-Yossef2019-04-18 15:39:02 +0200
committerHerbert Xu2019-04-25 09:38:15 +0200
commitf3df82b468f00cca241d96ee3697c9a5e7fb6bd0 (patch)
tree812b2022d64e0cf141f4fe665a69f69ee039d476 /drivers/crypto/ccree
parentcrypto: ccree - zap entire sg on aead request unmap (diff)
downloadkernel-qcow2-linux-f3df82b468f00cca241d96ee3697c9a5e7fb6bd0.tar.gz
kernel-qcow2-linux-f3df82b468f00cca241d96ee3697c9a5e7fb6bd0.tar.xz
kernel-qcow2-linux-f3df82b468f00cca241d96ee3697c9a5e7fb6bd0.zip
crypto: ccree - use correct internal state sizes for export
We were computing the size of the import buffer based on the digest size but the 318 and 224 byte variants use 512 and 256 bytes internal state sizes respectfully, thus causing the import buffer to overrun. Fix it by using the right sizes. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree')
-rw-r--r--drivers/crypto/ccree/cc_hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/ccree/cc_hash.c b/drivers/crypto/ccree/cc_hash.c
index 940101fee68e..36e9fb4141f8 100644
--- a/drivers/crypto/ccree/cc_hash.c
+++ b/drivers/crypto/ccree/cc_hash.c
@@ -1633,7 +1633,7 @@ static struct cc_hash_template driver_hash[] = {
.setkey = cc_hash_setkey,
.halg = {
.digestsize = SHA224_DIGEST_SIZE,
- .statesize = CC_STATE_SIZE(SHA224_DIGEST_SIZE),
+ .statesize = CC_STATE_SIZE(SHA256_DIGEST_SIZE),
},
},
.hash_mode = DRV_HASH_SHA224,
@@ -1660,7 +1660,7 @@ static struct cc_hash_template driver_hash[] = {
.setkey = cc_hash_setkey,
.halg = {
.digestsize = SHA384_DIGEST_SIZE,
- .statesize = CC_STATE_SIZE(SHA384_DIGEST_SIZE),
+ .statesize = CC_STATE_SIZE(SHA512_DIGEST_SIZE),
},
},
.hash_mode = DRV_HASH_SHA384,