From: Herbert Xu Date: Thu, 25 Jun 2009 06:46:31 +0000 (+0800) Subject: crypto: skcipher - Fix request for sync algorithms X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=435578aeaad5859dda8657e3ed2c1a5bc1e524ec;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index e11ce37c7104..43fc8fb9f978 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;