crypto: cryptd - Propagate new AEAD implementation flag
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 8 Jul 2015 23:17:19 +0000 (07:17 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Jul 2015 06:56:45 +0000 (14:56 +0800)
This patch allows the CRYPTO_ALG_AEAD_NEW flag to be propagated.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/cryptd.c

index 2f833dcc1711aa7c38f882ac35451407d8f58924..360ee85543fdb3ea28fd5e8380c63bcdb7350418 100644 (file)
@@ -176,10 +176,9 @@ static inline void cryptd_check_internal(struct rtattr **tb, u32 *type,
        algt = crypto_get_attr_type(tb);
        if (IS_ERR(algt))
                return;
-       if ((algt->type & CRYPTO_ALG_INTERNAL))
-               *type |= CRYPTO_ALG_INTERNAL;
-       if ((algt->mask & CRYPTO_ALG_INTERNAL))
-               *mask |= CRYPTO_ALG_INTERNAL;
+
+       *type |= algt->type & (CRYPTO_ALG_INTERNAL | CRYPTO_ALG_AEAD_NEW);
+       *mask |= algt->mask & (CRYPTO_ALG_INTERNAL | CRYPTO_ALG_AEAD_NEW);
 }
 
 static int cryptd_blkcipher_setkey(struct crypto_ablkcipher *parent,
@@ -806,7 +805,9 @@ static int cryptd_create_aead(struct crypto_template *tmpl,
                goto out_drop_aead;
 
        inst->alg.base.cra_flags = CRYPTO_ALG_ASYNC |
-                                  (alg->base.cra_flags & CRYPTO_ALG_INTERNAL);
+                                  (alg->base.cra_flags &
+                                   (CRYPTO_ALG_INTERNAL |
+                                    CRYPTO_ALG_AEAD_NEW));
        inst->alg.base.cra_ctxsize = sizeof(struct cryptd_aead_ctx);
 
        inst->alg.ivsize = crypto_aead_alg_ivsize(alg);