Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1443192lqp; Fri, 22 Mar 2024 15:28:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXb2xz4FvsxhsgI5031GtHB6gVtkDGeSh+6vn3g7iHbzUYFDsVsxRU2nzyAmp25OHWSDlcNJGjxmKzakflzuPl94GnZhfCqRTcnnYzMuw== X-Google-Smtp-Source: AGHT+IFkfEMLZ/xKOsID0FIXUt7K3aGeWVmx5rJp52/YaJzVCbEFnCOEPfZllWRE09jk7aBIE6Yx X-Received: by 2002:a05:6a00:190e:b0:6ea:902d:c36a with SMTP id y14-20020a056a00190e00b006ea902dc36amr1175687pfi.34.1711146494399; Fri, 22 Mar 2024 15:28:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711146494; cv=pass; d=google.com; s=arc-20160816; b=zp/1+7p2bTZ7SSOauxOqPI4QevfIHWwY6N5xqZAhwOxNYs/F72HRRp5QUnVi/RrbJz q022GW5qAZjXWbuWWp50kZsAfmppFSkgYEQYZwE0P3P7NhETG4mRxo6Da8g80dAmZ3Xq PM7p6SS8btyhWu28p9YmW7WyLsAhWa7EUTol+b4nDRs00fWn0uSXkaHdyzsph6uZiPFd X8+xe4wT/pLOMfQEQCxTKYhEpyjDRpnyKZxSY4lBfuimMAydydjfjoJzUPuZIpp9Y9mk 4ZegcdYPcRn+f8aLAG9n+AhgH/vSj1HIpHS1LEYRzsig/ITN62ch428sTF6QtwMNHB5q x61g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=llqd4vl44lbR52iusjJpAY2ISHXydTQ1Dz1mQD75PVI=; fh=0niS24WNsJ3qGdSgCxniPMd11D5oKsjwDbhlx76nwdg=; b=kTpj+YpUZ34qeOLrSDPgOdH1GjZCDoyjT1ukWgFGNJCwiWxw4hTEo73zpSPuyceivq muoYHGH5mTSwi00lGwSprgUDOtuaHrBPDppUfFbAZ1ze3RTB4JZuuAMF28UbsHOTfy7o BWH5ZihnHW2sGedLWdnaFJ2prPA9XEM14y876lxmK4Z2lJc7XUs2S0CDC5pjXFcayybn BxXCF9MNz72BTbm88ENCCF3X7HQqT1yHHWeOt5VHqR/71mgJh8Dev+VTFc7gAgizNfRF AR1Irw9BuQTP7RQf0WVcbMvjQOyQiV/L1zDdUmsLwStT0hEtM2Q5byD1oWbZYVjfF0kV shNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-crypto+bounces-2828-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2828-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z187-20020a6265c4000000b006e72e3bbe3dsi439257pfb.102.2024.03.22.15.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 15:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2828-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=altlinux.org); spf=pass (google.com: domain of linux-crypto+bounces-2828-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2828-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1110F2828B5 for ; Fri, 22 Mar 2024 22:28:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AD4681208; Fri, 22 Mar 2024 22:28:08 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F73E81733; Fri, 22 Mar 2024 22:28:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711146488; cv=none; b=QWi4WvisN9el7eSLowlcXmMC9k7H6gUyApmRxMNDC8qaifgVLSXDynzt0dE0p92vNgZeqbo2CgkohWpcYfE6aYYR/EXyaBIXfgx9piJrNsxz186PavOsZSDCkSl5yeG6Fx4kQHD4xCuFhLdbFVxQmWh3gISjDDfP2unl97pUjlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711146488; c=relaxed/simple; bh=2dtKlD5/Zn6482Sk/YiH9qaWhZ1YrikhQwIjP0TL7Bo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ON1ClMa8vqRlAf/bbXlJYunk5BW5+9s/YFztJL+2ETM9JmmAARqQKtiYTJI/JzQVPNeSTbDjDZgdZa/ms+2nT4Nsr2ylbpOErQpbdbeylUXH8XHjgmydrCN6Vp/2ECt1NIfObxBHHZRwKTKjqgKq4RGEbRvVkWxfX8J0oyQ4o8k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id 12FCF72C8F5; Sat, 23 Mar 2024 01:27:58 +0300 (MSK) Received: from altlinux.org (sole.flsd.net [185.75.180.6]) by imap.altlinux.org (Postfix) with ESMTPSA id 090D736D071C; Sat, 23 Mar 2024 01:27:58 +0300 (MSK) Date: Sat, 23 Mar 2024 01:27:57 +0300 From: Vitaly Chikunov To: Stefan Berger Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, linux-kernel@vger.kernel.org, saulo.alessandre@tse.jus.br Subject: Re: [PATCH] crypto: ecdsa - Fix module auto-load on add-key Message-ID: <20240322222757.gsr4kto47imm5spj@altlinux.org> References: <20240321144433.1671394-1-stefanb@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20240321144433.1671394-1-stefanb@linux.ibm.com> On Thu, Mar 21, 2024 at 10:44:33AM -0400, Stefan Berger wrote: > Add module alias with the algorithm cra_name similar to what we have for > RSA-related and other algorithms. > > The kernel attempts to modprobe asymmetric algorithms using the names > "crypto-$cra_name" and "crypto-$cra_name-all." However, since these > aliases are currently missing, the modules are not loaded. For instance, > when using the `add_key` function, the hash algorithm is typically > loaded automatically, but the asymmetric algorithm is not. > > Steps to test: > > 1. Create certificate > > openssl req -x509 -sha256 -newkey ec \ > -pkeyopt "ec_paramgen_curve:secp384r1" -keyout key.pem -days 365 \ > -subj '/CN=test' -nodes -outform der -out nist-p384.der > > 2. Optionally, trace module requests with: trace-cmd stream -e module & > > 3. Trigger add_key call for the cert: > > # keyctl padd asymmetric "" @u < nist-p384.der > 641069229 > # lsmod | head -2 > Module Size Used by > ecdsa_generic 16384 0 > > Fixes: c12d448ba939 ("crypto: ecdsa - Register NIST P384 and extend test suite") > Cc: stable@vger.kernel.org > Signed-off-by: Stefan Berger Reviewed-by: Vitaly Chikunov > --- > crypto/ecdsa.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/crypto/ecdsa.c b/crypto/ecdsa.c > index fbd76498aba8..3f9ec273a121 100644 > --- a/crypto/ecdsa.c > +++ b/crypto/ecdsa.c > @@ -373,4 +373,7 @@ module_exit(ecdsa_exit); > MODULE_LICENSE("GPL"); > MODULE_AUTHOR("Stefan Berger "); > MODULE_DESCRIPTION("ECDSA generic algorithm"); > +MODULE_ALIAS_CRYPTO("ecdsa-nist-p192"); > +MODULE_ALIAS_CRYPTO("ecdsa-nist-p256"); > +MODULE_ALIAS_CRYPTO("ecdsa-nist-p384"); > MODULE_ALIAS_CRYPTO("ecdsa-generic"); > -- > 2.43.0