Skip to content

Commit 90246e7

Browse files
committed
crypto: hash - Fix async import on shash algorithm
The function shash_async_import did not initialise the descriptor correctly prior to calling the underlying shash import function. This patch adds the required initialisation. Reported-by: Miloslav Trmac <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 8128057 commit 90246e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crypto/shash.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,13 @@ static int shash_async_export(struct ahash_request *req, void *out)
310310

311311
static int shash_async_import(struct ahash_request *req, const void *in)
312312
{
313-
return crypto_shash_import(ahash_request_ctx(req), in);
313+
struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req));
314+
struct shash_desc *desc = ahash_request_ctx(req);
315+
316+
desc->tfm = *ctx;
317+
desc->flags = req->base.flags;
318+
319+
return crypto_shash_import(desc, in);
314320
}
315321

316322
static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm)

0 commit comments

Comments
 (0)