summaryrefslogtreecommitdiff
path: root/crypto/aead.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/aead.c')
-rw-r--r--crypto/aead.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/aead.c b/crypto/aead.c
index 8cdea89909cd..4bab3cff3578 100644
--- a/crypto/aead.c
+++ b/crypto/aead.c
@@ -174,6 +174,14 @@ static int crypto_old_aead_init_tfm(struct crypto_tfm *tfm)
return 0;
}
+static void crypto_aead_exit_tfm(struct crypto_tfm *tfm)
+{
+ struct crypto_aead *aead = __crypto_aead_cast(tfm);
+ struct aead_alg *alg = crypto_aead_alg(aead);
+
+ alg->exit(aead);
+}
+
static int crypto_aead_init_tfm(struct crypto_tfm *tfm)
{
struct crypto_aead *aead = __crypto_aead_cast(tfm);
@@ -189,6 +197,12 @@ static int crypto_aead_init_tfm(struct crypto_tfm *tfm)
aead->child = __crypto_aead_cast(tfm);
aead->authsize = alg->maxauthsize;
+ if (alg->exit)
+ aead->base.exit = crypto_aead_exit_tfm;
+
+ if (alg->init)
+ return alg->init(aead);
+
return 0;
}