]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - crypto/aead.c
OMAP: dmtimer: enable all timers to be wakeup events
[linux-2.6-omap-h63xx.git] / crypto / aead.c
index 3a6f3f52c7c71911ac6cd7506493fb24ccd8eb50..d9aa733db1647b51c1eea32de4840dc21cd9659d 100644 (file)
@@ -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));
 }