public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: [v3 PATCH 5/16] crypto: api - Do not clear type bits in crypto_larval_lookup
Date: Tue, 22 Nov 2016 20:08:21 +0800	[thread overview]
Message-ID: <E1c99s5-00037q-8C@gondobar> (raw)
In-Reply-To: 20161122120703.GA11911@gondor.apana.org.au

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>
---

 crypto/api.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/api.c b/crypto/api.c
index a88729f..b16ce16 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) {

  parent reply	other threads:[~2016-11-22 12:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 12:07 [v3 PATCH 0/16] crypto: skcipher - skcipher algorithm conversion part 3 Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 1/16] crypto: skcipher - Add skcipher walk interface Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 2/16] crypto: aes-ce-ccm - Use " Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 3/16] crypto: lrw - Convert to skcipher Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 4/16] crypto: xts " Herbert Xu
2016-11-22 12:08 ` Herbert Xu [this message]
2016-11-22 12:08 ` [v3 PATCH 6/16] crypto: cryptd - Add support for skcipher Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 7/16] crypto: simd - Add simd skcipher helper Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 8/16] crypto: pcbc - Convert to skcipher Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 9/16] crypto: glue_helper - Add skcipher xts helpers Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 10/16] crypto: testmgr - Do not test internal algorithms Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 11/16] crypto: aesni - Convert to skcipher Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 12/16] crypto: arm64/aes " Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 13/16] crypto: aes-ce " Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 14/16] crypto: cbc " Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 15/16] crypto: cbc - Export CBC implementation Herbert Xu
2016-11-22 12:08 ` [v3 PATCH 16/16] crypto: aesbs - Convert to skcipher Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1c99s5-00037q-8C@gondobar \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox