diff mbox

[v2,13/13] crypto: algif_aead - Switch to new AEAD interface

Message ID 20150522215818.GB11512@gondor.apana.org.au
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Herbert Xu May 22, 2015, 9:58 p.m. UTC
On Fri, May 22, 2015 at 11:04:39PM +0200, Stephan Mueller wrote:
>
> Note, gcm(aes) looks good. Only rfc4106(gcm(aes)) causes the crash.

Actually it looks like the culprit hasn't been merged yet so I'll
just respin the series.

Anyway, this patch should fix your crash:

Comments

Stephan Mueller May 23, 2015, 6:04 p.m. UTC | #1
Am Samstag, 23. Mai 2015, 05:58:18 schrieb Herbert Xu:

Hi Herbert,

> On Fri, May 22, 2015 at 11:04:39PM +0200, Stephan Mueller wrote:
> > Note, gcm(aes) looks good. Only rfc4106(gcm(aes)) causes the crash.
> 
> Actually it looks like the culprit hasn't been merged yet so I'll
> just respin the series.
> 
> Anyway, this patch should fix your crash:

That fixes the rfc4106(gcm(aes)) issue. Thanks.
diff mbox

Patch

diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index b3dded4..b15d797 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -586,6 +586,13 @@  static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
 	if (!tmpl)
 		goto kill_larval;
 
+	if (tmpl->create) {
+		err = tmpl->create(tmpl, tb);
+		if (err)
+			goto put_tmpl;
+		goto ok;
+	}
+
 	inst = tmpl->alloc(tb);
 	err = PTR_ERR(inst);
 	if (IS_ERR(inst))
@@ -597,6 +604,7 @@  static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
 		goto put_tmpl;
 	}
 
+ok:
 	/* Redo the lookup to use the instance we just registered. */
 	err = -EAGAIN;
 
diff --git a/crypto/aead.c b/crypto/aead.c
index 8b26613..070e4b9 100644
--- a/crypto/aead.c
+++ b/crypto/aead.c
@@ -570,6 +570,13 @@  static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask)
 	if (!tmpl)
 		goto kill_larval;
 
+	if (tmpl->create) {
+		err = tmpl->create(tmpl, tb);
+		if (err)
+			goto put_tmpl;
+		goto ok;
+	}
+
 	inst = tmpl->alloc(tb);
 	err = PTR_ERR(inst);
 	if (IS_ERR(inst))
@@ -581,6 +588,7 @@  static int crypto_nivaead_default(struct crypto_alg *alg, u32 type, u32 mask)
 		goto put_tmpl;
 	}
 
+ok:
 	/* Redo the lookup to use the instance we just registered. */
 	err = -EAGAIN;