Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13118217rwl; Wed, 4 Jan 2023 03:56:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXuouPAux0YyLN3/93EFvJp/2J4QZlDQvmCbENLGbUJIwZA3pyF+DcuA1ce/Ib09P+AXln8C X-Received: by 2002:a05:6402:448e:b0:48e:8971:d28e with SMTP id er14-20020a056402448e00b0048e8971d28emr10980257edb.15.1672833410682; Wed, 04 Jan 2023 03:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672833410; cv=none; d=google.com; s=arc-20160816; b=O2I2qIFVL+Kv3J+i/iZtMJf7teTTjjd1zhOvJpdXgNcJpBEPeB0eWP59sdHT/Te/f+ 1I2Vil+E51JyjSNFppB+85uA9Ygx4TJD96wezy3nBNx7xudo2W38tNYkrY9+rRSvl7lg hJdsp5Lw3/RkvhVfY3p+xl4Zj535Whq+HcVBbzZzy/mRgtsTHSMwFSb+3ROvpX9Z51jh gP93OF6iAkFcBBgA1FvR+sRSWy9F5Uh6wJvcaXjOAfXhu3MsVrU5qJJLVmGq6BwlsJ18 zWm5a/vVvULrHXN/Rd5o6zr9qWVwEoyjpTi7LCcp52RmNxB/5z1r6rutryrEatAoRIV6 fqEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cou5NvSMGrP1hS2gKy5+6dxmrS2UezR3ehZQqdijrNM=; b=M6RMOKYouvg4H82LhAqOwY+VOYYD6XaDdG4qwcoaV2DQwIVWXsxpWUy3oePgOcAcV5 F6pCpgdJh8cFinl4Z5C5TVPM6UDqyWkCL6XSBIyzRfMiEq0+RuGUSDyDSU+o1dJEMT2M M/bKeTHwmAZJzTygFYnxa8Dww7q5AWKqtcqc+iKTcw/bdrqsSUJZjgAYf9vLlME4b++i fL5/AWb4KlnLNL41Tpivpm6A0ndWvtdu1EDCLNpVeRG7+outaVSR0nnw01bR8Sf3wIpn m29vDFuyU+D9DDSdEM5mQIvTGAoqWJmYLsndRPCG3LcdCBoypC93aKcawwsqTQKl9FRH WdrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EzEOndpC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a05640227d000b004676b7d42d7si35023246ede.243.2023.01.04.03.56.26; Wed, 04 Jan 2023 03:56:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EzEOndpC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239161AbjADLzW (ORCPT + 99 others); Wed, 4 Jan 2023 06:55:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233892AbjADLyx (ORCPT ); Wed, 4 Jan 2023 06:54:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6852A1EC45; Wed, 4 Jan 2023 03:54:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E2DE8613E9; Wed, 4 Jan 2023 11:54:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF661C433EF; Wed, 4 Jan 2023 11:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672833289; bh=2h492Ot3amT7yprfX9Jew+1cyS+yy617WjcWHESIjPk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EzEOndpCGhaX4IzFlcKlYEqBGOiXvlbMxiP5/5bS/88n68Qrez6S2JkDpx1Qkp9iX aj9jcOcOZeiM12QXrh1H3tewVkey6754EnueMTsaYkB+KY7liqiPCVihVbQoH88Txq W5RoQZ5QH3bnVJzmjL75JscQe6H4/dkxaFpv7TYgNyXKhFweTBhQjsMfY2CSsA1amb hFj6q8Ty8oSSvxGFUdMY0HY83hZDcO0VhGKUus1CttVFTVZyFkhTmFTqwUKjxACbsI LyxtpOQLvBww2zYDb4SkhkIThtSEnsDoZZ4dpPKxJbqMTGzJLUQeYiQn6x4GxCnq5V 6K3NsT+jEoluw== Date: Wed, 4 Jan 2023 11:54:46 +0000 From: Jarkko Sakkinen To: Eric Snowberg Cc: zohar@linux.ibm.com, dhowells@redhat.com, dwmw2@infradead.org, herbert@gondor.apana.org.au, davem@davemloft.net, dmitry.kasatkin@gmail.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, pvorel@suse.cz, noodles@fb.com, tiwai@suse.de, kanth.ghatraju@oracle.com, konrad.wilk@oracle.com, erpalmer@linux.vnet.ibm.com, coxu@redhat.com, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v3 09/10] KEYS: CA link restriction Message-ID: References: <20221214003401.4086781-1-eric.snowberg@oracle.com> <20221214003401.4086781-10-eric.snowberg@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Wed, Jan 04, 2023 at 11:51:52AM +0000, Jarkko Sakkinen wrote: > On Tue, Dec 13, 2022 at 07:34:00PM -0500, Eric Snowberg wrote: > > +/** > > + * restrict_link_by_ca - Restrict additions to a ring of CA keys > > + * @dest_keyring: Keyring being linked to. > > + * @type: The type of key being added. > > + * @payload: The payload of the new key. > > + * @trust_keyring: Unused. > > + * > > + * Check if the new certificate is a CA. If it is a CA, then mark the new > > + * certificate as being ok to link. > > + * > > + * Returns 0 if the new certificate was accepted, -ENOKEY if the > > + * certificate is not a CA. -ENOPKG if the signature uses unsupported > > + * crypto, or some other error if there is a matching certificate but > > + * the signature check cannot be performed. > > + */ > > +int restrict_link_by_ca(struct key *dest_keyring, > > + const struct key_type *type, > > + const union key_payload *payload, > > + struct key *trust_keyring) > > Why you want to define trust_keyring, other than matching the parameter > list in restrict_link_by_signature()? > > Also if it is unused, it should be then just "struct key *)", right? Please ignore, I forgot how this worked, i.e. "restriction" is set to the correct function so this looks correct to me :-) So it's good. Sorry for the confusion. BR, Jarkko