crypto: sahara - fix ahash reqsize
authorOvidiu Panait <ovidiu.panait@windriver.com>
Sun, 24 Dec 2023 08:21:32 +0000 (10:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:18 +0000 (15:35 -0800)
[ Upstream commit efcb50f41740ac55e6ccc4986c1a7740e21c62b4 ]

Set the reqsize for sha algorithms to sizeof(struct sahara_sha_reqctx), the
extra space is not needed.

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/sahara.c

index 96f59d5..80d419d 100644 (file)
@@ -1162,8 +1162,7 @@ static int sahara_sha_import(struct ahash_request *req, const void *in)
 static int sahara_sha_cra_init(struct crypto_tfm *tfm)
 {
        crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
-                                sizeof(struct sahara_sha_reqctx) +
-                                SHA_BUFFER_LEN + SHA256_BLOCK_SIZE);
+                                sizeof(struct sahara_sha_reqctx));
 
        return 0;
 }