瀏覽代碼

crypto: api - crypto_alg_mod_lookup either tested or untested

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>
Herbert Xu 16 年之前
父節點
當前提交
ff753308d2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      crypto/api.c

+ 1 - 1
crypto/api.c

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