crypto: aead - Do not set cra_type for new style instances
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 23 May 2015 07:41:53 +0000 (15:41 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 25 May 2015 10:41:31 +0000 (18:41 +0800)
The function aead_geniv_alloc currently sets cra_type even for
new style instances.  This is unnecessary and may hide bugs such
as when our caller uses crypto_register_instance instead of the
correct aead_register_instance.

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

index a6385bd0e05000251f9656ab77c2eaa5a35e5722..070e4b9e94f8bc890d31e8e9334a53850b3e7fa2 100644 (file)
@@ -468,12 +468,10 @@ struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
            CRYPTO_MAX_ALG_NAME)
                goto err_drop_alg;
 
-       inst->alg.base.cra_flags = CRYPTO_ALG_TYPE_AEAD;
-       inst->alg.base.cra_flags |= alg->base.cra_flags & CRYPTO_ALG_ASYNC;
+       inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC;
        inst->alg.base.cra_priority = alg->base.cra_priority;
        inst->alg.base.cra_blocksize = alg->base.cra_blocksize;
        inst->alg.base.cra_alignmask = alg->base.cra_alignmask;
-       inst->alg.base.cra_type = &crypto_new_aead_type;
 
        inst->alg.ivsize = ivsize;
        inst->alg.maxauthsize = maxauthsize;