Skip to content

Commit

Permalink
crypto: aead - Do not set cra_type for new style instances
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed May 25, 2015
1 parent 1e419c7 commit d1ee1f0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crypto/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1ee1f0

Please sign in to comment.