diff options
-rw-r--r-- | crypto/aead.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/aead.c b/crypto/aead.c index 3a6f3f52c7c7..d9aa733db164 100644 --- a/crypto/aead.c +++ b/crypto/aead.c | |||
@@ -422,6 +422,22 @@ static struct crypto_alg *crypto_lookup_aead(const char *name, u32 type, | |||
422 | if (!alg->cra_aead.ivsize) | 422 | if (!alg->cra_aead.ivsize) |
423 | return alg; | 423 | return alg; |
424 | 424 | ||
425 | crypto_mod_put(alg); | ||
426 | alg = crypto_alg_mod_lookup(name, type | CRYPTO_ALG_TESTED, | ||
427 | mask & ~CRYPTO_ALG_TESTED); | ||
428 | if (IS_ERR(alg)) | ||
429 | return alg; | ||
430 | |||
431 | if (alg->cra_type == &crypto_aead_type) { | ||
432 | if ((alg->cra_flags ^ type ^ ~mask) & CRYPTO_ALG_TESTED) { | ||
433 | crypto_mod_put(alg); | ||
434 | alg = ERR_PTR(-ENOENT); | ||
435 | } | ||
436 | return alg; | ||
437 | } | ||
438 | |||
439 | BUG_ON(!alg->cra_aead.ivsize); | ||
440 | |||
425 | return ERR_PTR(crypto_nivaead_default(alg, type, mask)); | 441 | return ERR_PTR(crypto_nivaead_default(alg, type, mask)); |
426 | } | 442 | } |
427 | 443 | ||