Skip to content

Commit 430b441

Browse files
committed
crypto: api - Do not clear type bits in crypto_larval_lookup
Currently all bits not set in mask are cleared in crypto_larval_lookup. This is unnecessary as wherever the type bits are used it is always masked anyway. This patch removes the clearing so that we may use bits set in the type but not in the mask for special purposes, e.g., picking up internal algorithms. Signed-off-by: Herbert Xu <[email protected]>
1 parent f1c131b commit 430b441

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
211211
if (!name)
212212
return ERR_PTR(-ENOENT);
213213

214+
type &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
214215
mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
215-
type &= mask;
216216

217217
alg = crypto_alg_lookup(name, type, mask);
218218
if (!alg) {

0 commit comments

Comments
 (0)