diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-11-04 13:00:22 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-11-04 14:48:37 -0400 |
commit | 88c0167bfd1f6bf743cd2c9a2816eb1c4951027b (patch) | |
tree | 7a311ad00a76ca657c857f3009d458c536853c60 /crypto/shash.c | |
parent | ae4852062ba8c438d7e054d81fb6a22f3265ee12 (diff) | |
download | linux-crypto-88c0167bfd1f6bf743cd2c9a2816eb1c4951027b.tar.gz linux-crypto-88c0167bfd1f6bf743cd2c9a2816eb1c4951027b.zip |
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 <mitr@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/shash.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index 22fd9433..76f74b96 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -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) |