summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-06-25 14:46:31 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2009-06-25 14:46:31 +0800
commitc91b102c4960baa54478289e65ab8551d84bcdee (patch)
treeff7b05222d011f7842b664d226652729f544a48e
parent1a0fd3c7e7618a3ff72b7f1f6de3d4deb7127c7b (diff)
downloadlinux-crypto-c91b102c4960baa54478289e65ab8551d84bcdee.tar.gz
linux-crypto-c91b102c4960baa54478289e65ab8551d84bcdee.zip
crypto: skcipher - Fix request for sync algorithms
When a sync givcipher algorithm is requested, if an async version of the same algorithm already exists, then we will loop forever without ever constructing the sync version based on a blkcipher. This is because we did not include the requested type/mask when getting a larval for the geniv algorithm that is to be constructed. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/ablkcipher.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index e11ce37c..43fc8fb9 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -201,8 +201,9 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
int err;
larval = crypto_larval_lookup(alg->cra_driver_name,
+ (type & ~CRYPTO_ALG_TYPE_MASK) |
CRYPTO_ALG_TYPE_GIVCIPHER,
- CRYPTO_ALG_TYPE_MASK);
+ mask | CRYPTO_ALG_TYPE_MASK);
err = PTR_ERR(larval);
if (IS_ERR(larval))
goto out;