Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715419rdb; Mon, 2 Oct 2023 20:44:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF429MXOKaK49S5HhSeLmVVy0GifY6DDu6suNLzkTHn+6rhiizXowB9Z1nur676qlpzrzZH X-Received: by 2002:a05:6a20:9783:b0:159:fe1d:2f32 with SMTP id hx3-20020a056a20978300b00159fe1d2f32mr10303678pzc.42.1696304692549; Mon, 02 Oct 2023 20:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304692; cv=none; d=google.com; s=arc-20160816; b=GNs0YJvunmul6iKdW372iqli7KSEFq3Vfh2qYb25Mpi2MGbahrISUhRcM+hGC2hcRX ztVSJMzVyWJVRshX7FHyPvEoiFikYJF5J6c00q5XRwi/c+xBkzj3DY5lemVhX3EFrTBO yEAi5s6W5un2Ow3EZVjNxp2jAB7vbvLEHku82Vj0OJ8kQ0Rdd5r+6f7NuSh4qNHinYd3 sxy6WcdX0i+5Jc8zeS706hWeB7ZbBFq0SXMgvhnSu88DzOMqrcU+VgV6pZW7u1oPAF/v X/v6XCYdBbPYWxHY+jYna9EVKCcp/hKR1s0SV1vCkg1dtEDnmpMs6yEcQst/Wx0KG7wn IYtQ== 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=SOrXqlWjQVNSTidNVqJ2scBJFVFRgDD5tw+IE+YWF8k=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=G1Kx+PMdNyfFVFa2lkc6tmcOqhhu8X9yLFG/S+4Are1PXlSeDL5JmghnODfJOMoPLj RrdNqxXttZJ19ZDe1c3eBIcl25UfmiVfM6H5doLEOkoF5PGXheB+QRG7fJvxXBFS+vav GZS7ZFI7kdr4nqfws3pZ+vh6iotAX0AgC++I1Sst1YWkFQkD7QJaqe3XHXj1IuL1aRY7 HLDt9iNM7nrTCaE1r9xzT4Y5gqolPEJ6hB6SZn4nHzmjtU4VCr7An1G8hvN9c8azG19s SzZDtkte/aayFh9KvkcfpD6fvhlbhW0whkL9Nx4PvX3kXwoqojYbzZLhQASyT9BHi26p WuZg== 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 w12-20020a056a0014cc00b0068a6f573f6asi582716pfu.213.2023.10.02.20.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:44:52 -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 DD87280C4D6F; 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 S230103AbjJCDou (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbjJCDoq (ORCPT ); Mon, 2 Oct 2023 23:44:46 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BC49C6 for ; Mon, 2 Oct 2023 20:44:43 -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 1qnWKs-002wRL-DK; Tue, 03 Oct 2023 11:44:39 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:42 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 07/16] crypto: authencesn - Only access common skcipher fields on spawn Date: Tue, 3 Oct 2023 11:43:24 +0800 Message-Id: <20231003034333.1441826-8-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:51 -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/authencesn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/authencesn.c b/crypto/authencesn.c index 91424e791d5c..60e9568f023f 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c @@ -390,9 +390,9 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl, u32 mask; struct aead_instance *inst; struct authenc_esn_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); @@ -415,7 +415,7 @@ static int crypto_authenc_esn_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); err = -ENAMETOOLONG; if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, @@ -435,8 +435,8 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl, enc->base.cra_alignmask; inst->alg.base.cra_ctxsize = sizeof(struct crypto_authenc_esn_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_esn_init_tfm; -- 2.39.2