From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E9A1C47DD9 for ; Wed, 27 Mar 2024 15:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:To:From:Subject: Cc:Message-Id:Date:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WEgPAkxZJNhSvl9FETC6GcHZVoz3oStImIcvDXDvnyU=; b=gs5t+bEkQ9Dp76 XbsAXcq0Dw1v2dF5ecabUKzZVNjqmPuKYD32R2iYKSFSD9Brp1nqS5XSaY3wjjZSB6G0Ik6VPkkuF IJTKl8m0NzJav8UVlULtB4sK6+XUZCKker6N3nwyS5bZmu/LmvRz6jVXThv9uXKUZpSrxlkehpmDE 3ZN5GqK3smLZE0Ux0Y2+wmuBS9vEogqIoSgPGFOA4KQOlUF+/b41BpfJZEXaCiNgi90ZxnqZz5boD Wjdv+8HDpqxJmJFu2XPQTCm4FlTTEIELQDlRAAqMEfSltcJE20TlAvrsbtvNII0A1+n0AtPtrl1Fc Co+jQsFXPQgdOo0cnUQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpVEf-00000009owR-3ifW; Wed, 27 Mar 2024 15:30:41 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpVEd-00000009ovA-2cFf for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2024 15:30:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CC2AECE26FA; Wed, 27 Mar 2024 15:30:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E79D6C43390; Wed, 27 Mar 2024 15:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711553437; bh=5lCcbaEaSY7dHdLxssGWY/edPLmaKRsRypjga0DHgRQ=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=RTuEzTHRdnapeyHjFoSR9jpteDd+sibEeJ/TWAKFfDzLI0TGODFCO0FYHFmGf5jXd gJP06SupWUPkeX9f2NqvMFnh/5pF5WdSBz02QBFMBOsChwWBKpQeAwghpwvPjTKcNx qX7yFkfnKOzbrqD88EI9ZwWbLB44onO1bS2aW8XU5ovW1eC20mdyXhQxVVw+WO1hw4 8KsfaqtigS4ksoNpvDRc/bTF9/ZZq86lRjq+cesllGxvGyEwMYZkdioWBuVj6b9BZR yPmwzaC1F2nJzklX2JxaGzDF/qlDtVpd9AKHkWUzM9sCIkzPEsKSRUOHiLD9veqwUu 7/DoYQC0k8Q5A== Mime-Version: 1.0 Date: Wed, 27 Mar 2024 17:30:28 +0200 Message-Id: Cc: "Shawn Guo" , "Jonathan Corbet" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "NXP Linux Team" , "Ahmad Fatoum" , "sigma star Kernel Team" , "David Howells" , "Li Yang" , "Paul Moore" , "James Morris" , "Serge E. Hallyn" , "Paul E. McKenney" , "Randy Dunlap" , "Catalin Marinas" , "Rafael J. Wysocki" , "Tejun Heo" , "Steven Rostedt (Google)" , , , , , , , , Subject: Re: [PATCH v7 2/6] KEYS: trusted: improve scalability of trust source config From: "Jarkko Sakkinen" To: "David Gstir" , "Mimi Zohar" , "James Bottomley" , "Herbert Xu" , "David S. Miller" X-Mailer: aerc 0.17.0 References: <20240327082454.13729-1-david@sigma-star.at> <20240327082454.13729-3-david@sigma-star.at> In-Reply-To: <20240327082454.13729-3-david@sigma-star.at> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240327_083040_039022_1411200C X-CRM114-Status: GOOD ( 17.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed Mar 27, 2024 at 10:24 AM EET, David Gstir wrote: > Enabling trusted keys requires at least one trust source implementation > (currently TPM, TEE or CAAM) to be enabled. Currently, this is > done by checking each trust source's config option individually. > This does not scale when more trust sources like the one for DCP > are added, because the condition will get long and hard to read. > > Add config HAVE_TRUSTED_KEYS which is set to true by each trust source > once its enabled and adapt the check for having at least one active trust > source to use this option. Whenever a new trust source is added, it now > needs to select HAVE_TRUSTED_KEYS. > > Signed-off-by: David Gstir > --- > security/keys/trusted-keys/Kconfig | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/security/keys/trusted-keys/Kconfig b/security/keys/trusted-keys/Kconfig > index dbfdd8536468..553dc117f385 100644 > --- a/security/keys/trusted-keys/Kconfig > +++ b/security/keys/trusted-keys/Kconfig > @@ -1,3 +1,6 @@ > +config HAVE_TRUSTED_KEYS > + bool > + > config TRUSTED_KEYS_TPM > bool "TPM-based trusted keys" > depends on TCG_TPM >= TRUSTED_KEYS > @@ -9,6 +12,7 @@ config TRUSTED_KEYS_TPM > select ASN1_ENCODER > select OID_REGISTRY > select ASN1 > + select HAVE_TRUSTED_KEYS > help > Enable use of the Trusted Platform Module (TPM) as trusted key > backend. Trusted keys are random number symmetric keys, > @@ -20,6 +24,7 @@ config TRUSTED_KEYS_TEE > bool "TEE-based trusted keys" > depends on TEE >= TRUSTED_KEYS > default y > + select HAVE_TRUSTED_KEYS > help > Enable use of the Trusted Execution Environment (TEE) as trusted > key backend. > @@ -29,10 +34,11 @@ config TRUSTED_KEYS_CAAM > depends on CRYPTO_DEV_FSL_CAAM_JR >= TRUSTED_KEYS > select CRYPTO_DEV_FSL_CAAM_BLOB_GEN > default y > + select HAVE_TRUSTED_KEYS > help > Enable use of NXP's Cryptographic Accelerator and Assurance Module > (CAAM) as trusted key backend. > > -if !TRUSTED_KEYS_TPM && !TRUSTED_KEYS_TEE && !TRUSTED_KEYS_CAAM > -comment "No trust source selected!" > +if !HAVE_TRUSTED_KEYS > + comment "No trust source selected!" > endif Tested-by: Jarkko Sakkinen # for TRUSTED_KEYS_TPM Reviewed-by: Jarkko Sakkinen BR, Jarkko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel