Commit fb6de25c authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

crypto: pcbc - remove ability to wrap internal ciphers

Following commit 944585a6 ("crypto: x86/aes-ni - remove special
handling of AES in PCBC mode"), it's no longer needed for the PCBC
template to support wrapping a cipher that has the CRYPTO_ALG_INTERNAL
flag set.  Thus, remove this now-unused functionality to make PCBC
consistent with the other single block cipher templates.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 21f3ca6c
...@@ -219,18 +219,15 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb) ...@@ -219,18 +219,15 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
if (IS_ERR(algt)) if (IS_ERR(algt))
return PTR_ERR(algt); return PTR_ERR(algt);
if (((algt->type ^ CRYPTO_ALG_TYPE_SKCIPHER) & algt->mask) & if ((algt->type ^ CRYPTO_ALG_TYPE_SKCIPHER) & algt->mask)
~CRYPTO_ALG_INTERNAL)
return -EINVAL; return -EINVAL;
inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL);
if (!inst) if (!inst)
return -ENOMEM; return -ENOMEM;
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER | alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
(algt->type & CRYPTO_ALG_INTERNAL), CRYPTO_ALG_TYPE_MASK);
CRYPTO_ALG_TYPE_MASK |
(algt->mask & CRYPTO_ALG_INTERNAL));
err = PTR_ERR(alg); err = PTR_ERR(alg);
if (IS_ERR(alg)) if (IS_ERR(alg))
goto err_free_inst; goto err_free_inst;
...@@ -245,7 +242,6 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb) ...@@ -245,7 +242,6 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
if (err) if (err)
goto err_drop_spawn; goto err_drop_spawn;
inst->alg.base.cra_flags = alg->cra_flags & CRYPTO_ALG_INTERNAL;
inst->alg.base.cra_priority = alg->cra_priority; inst->alg.base.cra_priority = alg->cra_priority;
inst->alg.base.cra_blocksize = alg->cra_blocksize; inst->alg.base.cra_blocksize = alg->cra_blocksize;
inst->alg.base.cra_alignmask = alg->cra_alignmask; inst->alg.base.cra_alignmask = alg->cra_alignmask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment