Skip to content

Commit

Permalink
crypto: api - Do not clear type bits in crypto_larval_lookup
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
herbertx committed Nov 28, 2016
1 parent f1c131b commit 430b441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
if (!name)
return ERR_PTR(-ENOENT);

type &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
type &= mask;

alg = crypto_alg_lookup(name, type, mask);
if (!alg) {
Expand Down

0 comments on commit 430b441

Please sign in to comment.