aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-10-03 11:43:23 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-13 18:27:26 +0800
commitcae3304330b52091e132544b307d59cc873649ad (patch)
tree975c0d862a6841af7bf7b4acf48bd48ce49c3797 /crypto
parentcrypto: adiantum - Only access common skcipher fields on spawn (diff)
downloadwireguard-linux-cae3304330b52091e132544b307d59cc873649ad.tar.xz
wireguard-linux-cae3304330b52091e132544b307d59cc873649ad.zip
crypto: authenc - Only access common skcipher fields on spawn
As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/authenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c
index 3326c7343e86..fa896ab143bd 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -373,9 +373,9 @@ static int crypto_authenc_create(struct crypto_template *tmpl,
u32 mask;
struct aead_instance *inst;
struct authenc_instance_ctx *ctx;
+ struct skcipher_alg_common *enc;
struct hash_alg_common *auth;
struct crypto_alg *auth_base;
- struct skcipher_alg *enc;
int err;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask);
@@ -398,7 +398,7 @@ static int crypto_authenc_create(struct crypto_template *tmpl,
crypto_attr_alg_name(tb[2]), 0, mask);
if (err)
goto err_free_inst;
- enc = crypto_spawn_skcipher_alg(&ctx->enc);
+ enc = crypto_spawn_skcipher_alg_common(&ctx->enc);
ctx->reqoff = ALIGN(2 * auth->digestsize + auth_base->cra_alignmask,
auth_base->cra_alignmask + 1);
@@ -422,8 +422,8 @@ static int crypto_authenc_create(struct crypto_template *tmpl,
enc->base.cra_alignmask;
inst->alg.base.cra_ctxsize = sizeof(struct crypto_authenc_ctx);
- inst->alg.ivsize = crypto_skcipher_alg_ivsize(enc);
- inst->alg.chunksize = crypto_skcipher_alg_chunksize(enc);
+ inst->alg.ivsize = enc->ivsize;
+ inst->alg.chunksize = enc->chunksize;
inst->alg.maxauthsize = auth->digestsize;
inst->alg.init = crypto_authenc_init_tfm;