Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715468rdb; Mon, 2 Oct 2023 20:45:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNix5krDaRtwqJ72Qar/mqEh9PfA1uK67rRK42co5W7+wcFBxq4+ECeWtJp50MFl5rlEXH X-Received: by 2002:a05:6a00:b49:b0:68e:2d9d:b0cc with SMTP id p9-20020a056a000b4900b0068e2d9db0ccmr14750039pfo.6.1696304701615; Mon, 02 Oct 2023 20:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304701; cv=none; d=google.com; s=arc-20160816; b=DTPUPbk9mibOXx5gWnCkV3K9CObCp+xw3TWhoNRH01XtO41Iamcvb8E7qWwlsr44x3 gchjiol2JU1B/BHKtBuw4i4KAscR2tU+Ji8Y2lAVgB61ZBbNjLgu2mnwuhp/NzBir9yU MgekiYGfZFm0gNqNGTqXyikTvrGFqT1/aa7CtcJTRWBlUneZ+IQfxV6RkWLNkaNEKg43 KQCTwfV2rWqf7sr7qQtVip3XPba8HTUah2YIHONuakMqucpIxvlw83jpu76QQqmW/Qrx hdL8yEiHNvn/B3B7urg7W+3oMa1cBH1JAGi8XLj9hqUB/FQ5zEPyhAm1VFrHhOiLiury Yp7w== 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=aYVXJXgssprZ3mUVHrWgL3vSVK8oKgggOVGrqCA9alY=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=P4VMJWfFbR8MnLDr4f+7IR3Jy/bjPq8WUrwbbFZp42aCgwZUXp4dR3PdlA7yBbC5Gj TmkCxaSlceFnO1lltOdQH2q0pmcVBB50uUU4bXTut6HuuzdRK1k5CJsorYGw9X9YVoMh XqwqQtn9AzwKySjPVM2s6p1rd0xiQ96b/QFZ+kzNUTo1bgf/GTxe7gxz1hEpPtxGenkG BJRcd7Lp4giXZeV31de7QPAHawXn+QilPhnDksTn33plZGtr25GhWjXx2AUmWWOkmtrY 0zYU9HBPMsjg2fNPiQJHGFyqwDgSOTuC6Cn45iMRcmFkzMyyxTabu3zvy8rF8ePbC9A9 eigQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id k12-20020a6568cc000000b00565610b2ed5si461093pgt.794.2023.10.02.20.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:45:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 8D343801BA6F; Mon, 2 Oct 2023 20:44:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239032AbjJCDo5 (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbjJCDow (ORCPT ); Mon, 2 Oct 2023 23:44:52 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C149DCC for ; Mon, 2 Oct 2023 20:44:49 -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 1qnWKz-002wU3-02; Tue, 03 Oct 2023 11:44:46 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:49 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 13/16] crypto: hctr2 - Only access common skcipher fields on spawn Date: Tue, 3 Oct 2023 11:43:30 +0800 Message-Id: <20231003034333.1441826-14-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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:44:58 -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/hctr2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/hctr2.c b/crypto/hctr2.c index 6f4c1884d0e9..653fde727f0f 100644 --- a/crypto/hctr2.c +++ b/crypto/hctr2.c @@ -406,10 +406,10 @@ static int hctr2_create_common(struct crypto_template *tmpl, const char *xctr_name, const char *polyval_name) { + struct skcipher_alg_common *xctr_alg; u32 mask; struct skcipher_instance *inst; struct hctr2_instance_ctx *ictx; - struct skcipher_alg *xctr_alg; struct crypto_alg *blockcipher_alg; struct shash_alg *polyval_alg; char blockcipher_name[CRYPTO_MAX_ALG_NAME]; @@ -431,7 +431,7 @@ static int hctr2_create_common(struct crypto_template *tmpl, xctr_name, 0, mask); if (err) goto err_free_inst; - xctr_alg = crypto_spawn_skcipher_alg(&ictx->xctr_spawn); + xctr_alg = crypto_spawn_skcipher_alg_common(&ictx->xctr_spawn); err = -EINVAL; if (strncmp(xctr_alg->base.cra_name, "xctr(", 5)) @@ -500,8 +500,8 @@ static int hctr2_create_common(struct crypto_template *tmpl, inst->alg.decrypt = hctr2_decrypt; inst->alg.init = hctr2_init_tfm; inst->alg.exit = hctr2_exit_tfm; - inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(xctr_alg); - inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(xctr_alg); + inst->alg.min_keysize = xctr_alg->min_keysize; + inst->alg.max_keysize = xctr_alg->max_keysize; inst->alg.ivsize = TWEAK_SIZE; inst->free = hctr2_free_instance; -- 2.39.2