summaryrefslogtreecommitdiff
path: root/crypto/api.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-11-22 20:08:21 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-11-28 21:23:18 +0800
commitce0148027f6a49ff66235fac1505710124779088 (patch)
tree332f91addd901b23c5f1dda190deaec541a2e01e /crypto/api.c
parent6c1314f521f22ac9b8a234689885fe95d173bb92 (diff)
downloadlinux-crypto-ce0148027f6a49ff66235fac1505710124779088.tar.gz
linux-crypto-ce0148027f6a49ff66235fac1505710124779088.zip
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 <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/api.c b/crypto/api.c
index a88729ff..b16ce165 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -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) {