提交 435578ae 编写于 作者: H Herbert Xu

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: NHerbert Xu <herbert@gondor.apana.org.au>
上级 409a7363
...@@ -201,8 +201,9 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask) ...@@ -201,8 +201,9 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
int err; int err;
larval = crypto_larval_lookup(alg->cra_driver_name, larval = crypto_larval_lookup(alg->cra_driver_name,
(type & ~CRYPTO_ALG_TYPE_MASK) |
CRYPTO_ALG_TYPE_GIVCIPHER, CRYPTO_ALG_TYPE_GIVCIPHER,
CRYPTO_ALG_TYPE_MASK); mask | CRYPTO_ALG_TYPE_MASK);
err = PTR_ERR(larval); err = PTR_ERR(larval);
if (IS_ERR(larval)) if (IS_ERR(larval))
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册