crypto: api - crypto_alg_mod_lookup either tested or untested
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 17 Feb 2009 12:18:34 +0000 (20:18 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 18 Feb 2009 08:49:43 +0000 (16:49 +0800)
As it stands crypto_alg_mod_lookup will search either tested or
untested algorithms, but never both at the same time.  However,
we need exactly that when constructing givcipher and aead so
this patch adds support for that by setting the tested bit in
type but clearing it in mask.  This combination is currently
unused.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/api.c

index efe77df6863f4378f4f0da414591f940870b76ea..56b6e0e6631172f4f4bfde6b563bd936ae326a97 100644 (file)
@@ -244,7 +244,7 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
        struct crypto_alg *larval;
        int ok;
 
-       if (!(mask & CRYPTO_ALG_TESTED)) {
+       if (!((type | mask) & CRYPTO_ALG_TESTED)) {
                type |= CRYPTO_ALG_TESTED;
                mask |= CRYPTO_ALG_TESTED;
        }