diff options
author | Herbert Xu <herbert@gondor.hengli.com.au> | 2010-11-04 13:02:26 -0500 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-11-28 04:55:10 +0100 |
commit | f1d3cafc7f3684ce4e5f454c88cad155d07e047a (patch) | |
tree | 347c4533106efc531fb3571bb5f2740b7e80c12d | |
parent | 3298f4cab7d2502f9af48722f186e1c7400feba7 (diff) | |
download | kernel-crypto-f1d3cafc7f3684ce4e5f454c88cad155d07e047a.tar.gz kernel-crypto-f1d3cafc7f3684ce4e5f454c88cad155d07e047a.tar.xz kernel-crypto-f1d3cafc7f3684ce4e5f454c88cad155d07e047a.zip |
RFC: Crypto API User-interface
On Thu, Nov 04, 2010 at 01:43:16PM -0400, Miloslav Trmac wrote:
>
> shash_async_import() - it assumes that the struct shash_desc placed in ahash_request_ctx() of the struct ahash_request was initialized to point to the tfm, which is only done in shash_async_init().
Thanks for catching this. This patch should fix the problem.
commit 8850e3641dcc7446628681bd7c5f771005e0b208
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Nov 4 13:00:22 2010 -0500
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>
-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 22fd9433141..76f74b96315 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) |