Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3854390rdb; Thu, 14 Sep 2023 05:02:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZHpc9/l42E2AkV2SJnFPmv9W54Ry/VBmpGIY1XI2JpdirB1xNM8eVsTx4WEjE3lXCaK9a X-Received: by 2002:a92:c5cf:0:b0:34a:c28f:9416 with SMTP id s15-20020a92c5cf000000b0034ac28f9416mr5056780ilt.26.1694692937555; Thu, 14 Sep 2023 05:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694692937; cv=none; d=google.com; s=arc-20160816; b=djA3PYMipl+5Qfd9OfGwnHT0oJbmlAKkDSv85ZxsZCss34Pvi68JStQEeUhAhrsnyI 6KIoG78kM7IICymmnEaoS30hfPNvSoMMXazRwLWtSc7qlWidmfs6iLOCtcBSUCmRjX1+ NuJ6/KCsthSre5NM2leHXVQx3MxhkDv0vXyfHVz5KFVvJckuCt2sXW4Tsgy2zYkL/SQZ x/UpFSTDp7/CPTuScJRCVtkukXXQw4LhZvFrMlIHtoGfIw4u9tVddXf3AaYy7NAOYBpc df9dSUrRKZKdfn2f0xK0TegkKJG4HQOv9rv12OBIyjNoeqX083FYFJAiFOAKUkpDrsUT PYWQ== 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:sender :dkim-signature; bh=Wqi+NuwsYIx4ELvz9MrnCIei/niqfV1tNLHt9gSq9Lg=; fh=4tfMtIlwPZI19DAizsta/+tnqD+bc5RGCYEvvk+baVs=; b=jYqAHF22o3X1aSlR76nmlfhvXKndla3+ael9ZASjB6OejrPeJ1XNYpQ9BAp+DOUGSg W4f6tvd9ZJjmR9NXDlhgOJAhoa5mvFQCsMTQ73L+oq/oo9pa/qUxzwMrLfFgHZDBdPXH 2tkgBq+TQyETn/4TPcC5PJ3/+IKQoWI0PbdXk5NzA1W2tluG6rNHicmrm43Tom4Am3QK QlDDY1Z2niVP2xmSYprq/oOPf6qq/YQXKrR1ZIWJUNO606W7OSFmyU4G38OVQ0euuAAZ +FiemtZ/0wC3J1TBKnLJaYscy+L1z0aisb00WT4o8YMkH+msPnQZ2MTKoMGLnKSHuD+u XJzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=iXVEu7uh; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l21-20020a635715000000b00565d4ffe843si1358985pgb.418.2023.09.14.05.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 05:02:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=iXVEu7uh; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id BB71283154A6; Thu, 14 Sep 2023 01:28:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236621AbjINI2u (ORCPT + 99 others); Thu, 14 Sep 2023 04:28:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236473AbjINI2g (ORCPT ); Thu, 14 Sep 2023 04:28:36 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B5E1FD9 for ; Thu, 14 Sep 2023 01:28:32 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5774b3de210so512099a12.0 for ; Thu, 14 Sep 2023 01:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694680111; x=1695284911; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Wqi+NuwsYIx4ELvz9MrnCIei/niqfV1tNLHt9gSq9Lg=; b=iXVEu7uhUaQQShd8WAuPQg5R6cbi0YlhmpqkEfbqyPtSl41raP8r44BICZjPvy/IvU Rlr+HOobcnr7CbyVYZi0QTebbPn9sjTVFTeTunqqT4a/rG0garrx5oWeriU1tv8hlah/ IMbATdV5aZVBIzeRfGSwo8BdkPMK/72voAZ3g4qQqjyFPmjiHgQ2FWzgE9OmbO+b/ehR eR+ejsM+/PUA6CFQI3qHhzeQSYBfomgsT1Bp9UMLwGJv9HDuwu3UL2puYI5zq4NdPia9 aeW85n9JnQzTyDQGObg+PQa6r/gtj1plLiludQeTNY91T8yjfyJ7XWHDOUzb7jMYVWQL x4tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694680111; x=1695284911; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Wqi+NuwsYIx4ELvz9MrnCIei/niqfV1tNLHt9gSq9Lg=; b=RUQnVSMCxtzprjxPbxBmLunYLZ7jmGwy08kyDJqw0+u/Kb9i6+JQtQOtafOR5FWtA9 G2ZgNB4HW3T4HAlf+3ZkQkMPVA6oFxot8WH6axl4PWQsplCL7HVsLS2FzRBRhfnkCkUG pLpLlYf4X/rY+QAiPl9dckG+imp0+g5Kewvytw+KKhHPhu1qBremUQSxQxpDr1/3JQL+ XNMSWrDzk1julG6AtJcvddimt/yPk8ktIwW91Y2cU4uyLwFJm2/ywvxAU0N64Beswn5L Wz8VhHKfz/WzHaqXffLSrkoK7nisA9u0pO+IGJuP5XqUMf00gJPDpKaB43ShR2mSotnx 1hFQ== X-Gm-Message-State: AOJu0YzQi21yOLMDU4uPEt+5Uck8HKdlXYXghPqg2OnCNQSEGPESZMFN vEar0urLOkS44VJAtSmQgQyXt00TiMk= X-Received: by 2002:a05:6a21:4988:b0:151:991c:84b6 with SMTP id ax8-20020a056a21498800b00151991c84b6mr4283566pzc.59.1694680111166; Thu, 14 Sep 2023 01:28:31 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([2404:c804:1b2a:5507:c00a:8aff:fe00:b003]) by smtp.gmail.com with ESMTPSA id b13-20020a170902d50d00b001bba3a4888bsm976242plg.102.2023.09.14.01.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 01:28:30 -0700 (PDT) Sender: Herbert Xu From: Herbert Xu To: Linux Crypto Mailing List Cc: Ard Biesheuvel Subject: [PATCH 2/8] ipsec: Stop using crypto_has_alg Date: Thu, 14 Sep 2023 16:28:22 +0800 Message-Id: <20230914082828.895403-3-herbert@gondor.apana.org.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914082828.895403-1-herbert@gondor.apana.org.au> References: <20230914082828.895403-1-herbert@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 01:28:53 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 groat.vger.email Stop using the obsolete crypto_has_alg helper that is type-agnostic. Instead use the type-specific helpers such as the newly added crypto_has_aead. This means that changes in the underlying type/mask values won't affect IPsec. Signed-off-by: Herbert Xu --- net/xfrm/xfrm_algo.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index 094734fbec96..41533c631431 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c @@ -5,6 +5,7 @@ * Copyright (c) 2002 James Morris */ +#include #include #include #include @@ -644,38 +645,33 @@ static inline int calg_entries(void) } struct xfrm_algo_list { + int (*find)(const char *name, u32 type, u32 mask); struct xfrm_algo_desc *algs; int entries; - u32 type; - u32 mask; }; static const struct xfrm_algo_list xfrm_aead_list = { + .find = crypto_has_aead, .algs = aead_list, .entries = ARRAY_SIZE(aead_list), - .type = CRYPTO_ALG_TYPE_AEAD, - .mask = CRYPTO_ALG_TYPE_MASK, }; static const struct xfrm_algo_list xfrm_aalg_list = { + .find = crypto_has_ahash, .algs = aalg_list, .entries = ARRAY_SIZE(aalg_list), - .type = CRYPTO_ALG_TYPE_HASH, - .mask = CRYPTO_ALG_TYPE_HASH_MASK, }; static const struct xfrm_algo_list xfrm_ealg_list = { + .find = crypto_has_skcipher, .algs = ealg_list, .entries = ARRAY_SIZE(ealg_list), - .type = CRYPTO_ALG_TYPE_SKCIPHER, - .mask = CRYPTO_ALG_TYPE_MASK, }; static const struct xfrm_algo_list xfrm_calg_list = { + .find = crypto_has_comp, .algs = calg_list, .entries = ARRAY_SIZE(calg_list), - .type = CRYPTO_ALG_TYPE_COMPRESS, - .mask = CRYPTO_ALG_TYPE_MASK, }; static struct xfrm_algo_desc *xfrm_find_algo( @@ -696,8 +692,7 @@ static struct xfrm_algo_desc *xfrm_find_algo( if (!probe) break; - status = crypto_has_alg(list[i].name, algo_list->type, - algo_list->mask); + status = algo_list->find(list[i].name, 0, 0); if (!status) break; -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt