Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715409rdb; Mon, 2 Oct 2023 20:44:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMk8Wop/jcvuFnWcURBnPOs3OuLAQSZ2e9PZ6SNWo/xWRgDyr3UcA4IF7CzpO4ZwaWoGTG X-Received: by 2002:a17:902:e752:b0:1c7:60b8:625b with SMTP id p18-20020a170902e75200b001c760b8625bmr5810647plf.3.1696304691328; Mon, 02 Oct 2023 20:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304691; cv=none; d=google.com; s=arc-20160816; b=MRz8mv8VxB9Bf0qZF7Tsjj7VZ6FZxEn1hayMUGlvSIdHqnEv2b7aVr3RN84bgvUsU+ EOjButYEHI+c+aY88HwGUFF+DbqG+oHvmz+wMHN69JvmY4lQriW2gweKYNn/OU90KuCe zjEDGl3HmaM020YKS7w/PMFkaa4XHXhpDUtGUSS/6v/IU0TVIyzPLR4JyO44m5prcj4e xFTxfqVYrFXqVBs72L7u8yRIcEXz99fOKpuHz7NvQFp9XeDCW00i5nTG6/wS774kQwDk qmfws3cHXOr0psGD6C4A9eqR/hp7lJsQSbvRrBjHXyRhCd9ICyS8Mrb7pEhVEJI5aETF 29Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1xycusZiIkPmLm3Krysy77QkcRKO6iVHoD7P5vsjHTQ=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=SEEM6q87Vhz23wycd9qakYp1Xkgxn7p6HT1Uh32VGkt4MtXzrR1BxeM0X4pMmZvZZ0 Paty8Ztmu+R4eShyfNK3qMiTLWqFYWVYYu7FT3kzFWBbPguwY3A7I2tqRJKQx3Qq+F4s /Vei4P+JQ9nTp1cVRasc8yn3DLGWaIjGYhrpQIhrKgDV2fVgU0ng4PmxPEXXRFlvhSID 4jU5yvfuwqCLV23+0T0dJ6vtaaKJyM3sifdIaKyqSplDMMJ2fhFB/pwKOL0z16LPkvTF 4/8a33kMuFHM4GkmNhMXCqTmPznVVpoqyi63i1k2wynVgz+KvyWJhu6PNNUm3C8WU9l4 mGow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b13-20020a170902650d00b001c61226fe40si458505plk.392.2023.10.02.20.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3020081143C2; Mon, 2 Oct 2023 20:44:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbjJCDou (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbjJCDop (ORCPT ); Mon, 2 Oct 2023 23:44:45 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31BACC4 for ; Mon, 2 Oct 2023 20:44:42 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qnWKr-002wRC-AS; Tue, 03 Oct 2023 11:44:38 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:41 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 06/16] crypto: authenc - Only access common skcipher fields on spawn Date: Tue, 3 Oct 2023 11:43:23 +0800 Message-Id: <20231003034333.1441826-7-herbert@gondor.apana.org.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231003034333.1441826-1-herbert@gondor.apana.org.au> References: <20231003034333.1441826-1-herbert@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:44:50 -0700 (PDT) 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 --- crypto/authenc.c | 8 ++++---- 1 file 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; -- 2.39.2