Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1715424rdb; Mon, 2 Oct 2023 20:44:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKRxTdVQyI1M0vYNIYTOnc4a1YvncmLlBMCAEFD7v99QWEWzd8pgY7+mYLMb3HvI6crTn7 X-Received: by 2002:a05:6830:1690:b0:6b9:9f84:dc8b with SMTP id k16-20020a056830169000b006b99f84dc8bmr13308631otr.19.1696304693221; Mon, 02 Oct 2023 20:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696304693; cv=none; d=google.com; s=arc-20160816; b=0CqZ4ESLaDrexOV2N8v2gOD5O85c9BZfd+8TV99rDnzykeE+yKspH0EYl5Yly6FRNQ 892RWi6m9UcLrsieKCsu0NT6CoNIoEmGz7J7Q4ZY/BhFs5yj+wJ1VxgEGRjxvSgmGWRC 7TVYrw+LZYSSdh14jV7JtfNubWGSarU7s/V2TBXx/DMRkqx58VN7nA9rxOyHfFubegZM 7XlFajD+TEOaCyQzbREP2gqpMUYQVQypyeh1JhgR559xdp88jPCrRKCfSgLKLSiUkO2n rYUJM96Yiw2Tko3xQHmm1qa4Q7IZaaeIBSoo6ZOR0QOqaThqV//4YnHSMwyw+WOXfnWc QjtA== 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=whArmZXoQ/+1M9fNyruZeaXC6J2U989qNuH29fiytXI=; fh=l82EBe4859Giv8r8zr9oFIexxRwnYkkBFWiaDDuu954=; b=heAUaTbfotDKQ8NUUsDqZfBxeJ86e4NJE1+vK4zAh90/bKuWRM07n51alRXnuRmCP1 4rUBKRGA2OMW8IrqY9aso3O7IWC073jHHpc0/b5GYfm/2Cjkcyq9zf+I+WkxV/rXE/yL TasiKwkSHYIryVAO2LMCdLV7jDlHIPBPT3E3xHwroQ7tfXYHaXUBJEppTEvKOjAtfk5t CB13qNaAccOilmsuI7WH1ELZyHD9QHn8Rv+XayYmLmSfD+be2fmY7JOr4EQyC/wnr7Lg rlFYP6C3uJGhW6IaLlzsy0MqpxEzK3mGGTE9V7pr+Vpti967RwRrGk2g8JUdTSIxQhNN u6Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i73-20020a636d4c000000b00578b8016c40si550346pgc.93.2023.10.02.20.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:44:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:4 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 2722081143C2; Mon, 2 Oct 2023 20:44:52 -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 S230061AbjJCDow (ORCPT + 99 others); Mon, 2 Oct 2023 23:44:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjJCDou (ORCPT ); Mon, 2 Oct 2023 23:44:50 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F176BF for ; Mon, 2 Oct 2023 20:44:47 -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 1qnWKw-002wSv-RU; Tue, 03 Oct 2023 11:44:43 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 03 Oct 2023 11:44:46 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Shinichiro Kawasaki , Herbert Xu Subject: [PATCH 11/16] crypto: cts - Only access common skcipher fields on spawn Date: Tue, 3 Oct 2023 11:43:28 +0800 Message-Id: <20231003034333.1441826-12-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:52 -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/cts.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/cts.c b/crypto/cts.c index 8f604f6554b1..f5b42156b6c7 100644 --- a/crypto/cts.c +++ b/crypto/cts.c @@ -324,8 +324,8 @@ static void crypto_cts_free(struct skcipher_instance *inst) static int crypto_cts_create(struct crypto_template *tmpl, struct rtattr **tb) { struct crypto_skcipher_spawn *spawn; + struct skcipher_alg_common *alg; struct skcipher_instance *inst; - struct skcipher_alg *alg; u32 mask; int err; @@ -344,10 +344,10 @@ static int crypto_cts_create(struct crypto_template *tmpl, struct rtattr **tb) if (err) goto err_free_inst; - alg = crypto_spawn_skcipher_alg(spawn); + alg = crypto_spawn_skcipher_alg_common(spawn); err = -EINVAL; - if (crypto_skcipher_alg_ivsize(alg) != alg->base.cra_blocksize) + if (alg->ivsize != alg->base.cra_blocksize) goto err_free_inst; if (strncmp(alg->base.cra_name, "cbc(", 4)) @@ -363,9 +363,9 @@ static int crypto_cts_create(struct crypto_template *tmpl, struct rtattr **tb) inst->alg.base.cra_alignmask = alg->base.cra_alignmask; inst->alg.ivsize = alg->base.cra_blocksize; - inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); - inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg); - inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(alg); + inst->alg.chunksize = alg->chunksize; + inst->alg.min_keysize = alg->min_keysize; + inst->alg.max_keysize = alg->max_keysize; inst->alg.base.cra_ctxsize = sizeof(struct crypto_cts_ctx); -- 2.39.2