Skip to content

Commit

Permalink
crypto: hash - Fix async import on shash algorithm
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
herbertx committed Nov 4, 2010
1 parent 8128057 commit 90246e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crypto/shash.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,13 @@ static int shash_async_export(struct ahash_request *req, void *out)

static int shash_async_import(struct ahash_request *req, const void *in)
{
return crypto_shash_import(ahash_request_ctx(req), in);
struct crypto_shash **ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(req));
struct shash_desc *desc = ahash_request_ctx(req);

desc->tfm = *ctx;
desc->flags = req->base.flags;

return crypto_shash_import(desc, in);
}

static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm)
Expand Down

0 comments on commit 90246e7

Please sign in to comment.