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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A43DC4332F for ; Tue, 17 May 2022 17:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350878AbiEQR1c (ORCPT ); Tue, 17 May 2022 13:27:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235136AbiEQR13 (ORCPT ); Tue, 17 May 2022 13:27:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6709A396BA; Tue, 17 May 2022 10:27:27 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 0E2FAB81B1B; Tue, 17 May 2022 17:27:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B5C1C385B8; Tue, 17 May 2022 17:27:22 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="IilJz4sq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1652808440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GLxfMRWlDqJCqVnB0IaJbPRiH8haTaUzhJXTGYbu2uE=; b=IilJz4sqEicgZI5OMVtdivcdVlHTq1Rg6Pu7qkgijtuhKRntgRQ8i3VUQ7g1H+Hy9wFAeX rouEE4G/g0bPt2ghx/3eHUBc+McioIILlhtegmi3ETQ/lA/PZDVVnYhOCTWMJSAb7RVdGG gnm4HIjm1SSDp1eh2n3DcZqmuG9qC34= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id be7946cb (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 17 May 2022 17:27:19 +0000 (UTC) Date: Tue, 17 May 2022 19:27:08 +0200 From: "Jason A. Donenfeld" To: Ahmad Fatoum Cc: James Bottomley , Jarkko Sakkinen , Mimi Zohar , David Howells , kernel@pengutronix.de, Sumit Garg , Pankaj Gupta , David Gstir , Michael Walle , John Ernberg , James Morris , "Serge E. Hallyn" , Horia =?utf-8?Q?Geant=C4=83?= , Herbert Xu , "David S. Miller" , Jan Luebbe , Eric Biggers , Richard Weinberger , Franck LENORMAND , Matthias Schiffer , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v10 2/7] KEYS: trusted: allow use of kernel RNG for key material Message-ID: References: <20220513145705.2080323-1-a.fatoum@pengutronix.de> <20220513145705.2080323-3-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220513145705.2080323-3-a.fatoum@pengutronix.de> Precedence: bulk List-ID: On Fri, May 13, 2022 at 04:57:00PM +0200, Ahmad Fatoum wrote: > + trusted.rng= [KEYS] > + Format: > + The RNG used to generate key material for trusted keys. > + Can be one of: > + - "kernel" > + - the same value as trusted.source: "tpm" or "tee" > + - "default" > + If not specified, "default" is used. In this case, > + the RNG's choice is left to each individual trust source. > + As a general mechanism, I object to this. The kernel's RNG must be trusted in the first place for key material. That's the whole point of it. However, it sounds like you're not proposing a general mechanism, but just something particular to this "trusted keys" business. In that case, this should be a module flag, and thus not documented here, but rather some place namespaced to your trusted keys stuff. "trusted_keys.preferred_rng={whatever}" Jason