From 328f80df1d09b71e4b686fcd72b8b738b05ae5e2 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Wed, 18 Feb 2009 20:41:47 +0800 Subject: [PATCH] --- yaml --- r: 132696 b: refs/heads/master c: 5852ae42424e3ddba2d3bdf594f72189497f17ee h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/crypto/aead.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 656df9e44f75..ac30f70ab0a0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b170a137f467ea951c3f256da1b911545acf3ffd +refs/heads/master: 5852ae42424e3ddba2d3bdf594f72189497f17ee diff --git a/trunk/crypto/aead.c b/trunk/crypto/aead.c index 3a6f3f52c7c7..d9aa733db164 100644 --- a/trunk/crypto/aead.c +++ b/trunk/crypto/aead.c @@ -422,6 +422,22 @@ static struct crypto_alg *crypto_lookup_aead(const char *name, u32 type, if (!alg->cra_aead.ivsize) return alg; + crypto_mod_put(alg); + alg = crypto_alg_mod_lookup(name, type | CRYPTO_ALG_TESTED, + mask & ~CRYPTO_ALG_TESTED); + if (IS_ERR(alg)) + return alg; + + if (alg->cra_type == &crypto_aead_type) { + if ((alg->cra_flags ^ type ^ ~mask) & CRYPTO_ALG_TESTED) { + crypto_mod_put(alg); + alg = ERR_PTR(-ENOENT); + } + return alg; + } + + BUG_ON(!alg->cra_aead.ivsize); + return ERR_PTR(crypto_nivaead_default(alg, type, mask)); }