Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3985085iob; Tue, 17 May 2022 11:12:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMHW/C25w9FXDOidN7GquVjeJJlT2cP36SDHdxeDw7CgEocCKJhKniV4luFNng/QlFYbcD X-Received: by 2002:a17:90b:3101:b0:1df:58ec:ca8b with SMTP id gc1-20020a17090b310100b001df58ecca8bmr11516966pjb.50.1652811179689; Tue, 17 May 2022 11:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652811179; cv=none; d=google.com; s=arc-20160816; b=WvGydA/fRfI2wJp8eRNC0/UEYBIdXXPLiTppW9nMwfVASdWsbaeTAGK9/0ruVY4R9f 1/TlTZlU+nazlZpVucCVxBvxSG4LAzKNbiI4HDRC3+PrvFTvPIbVGvg+W5xWiEkA15tY vS2l0sf/7W/dyM4FRbAclpoX2+vBmTUAR4RokzEej6AfzsmaWcNOrL+eS61UtLOv7EJl I5e9MziptDq3atIkjoBk+bLfgfqrIPNcvc1kjBJMGz5h9x/jHNomPSE3gQz9XdmH2f2D gFcDbFOvO+7XW+LFHsTqdJ1kIr668uVt4YoBONBW9GxVeo+5wmiiAS1eXZDiaS29H1A6 H0+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=4fu7tG9A03p/YY19zoNUQMP1YfD7zGfbGVmmnSmq0Uo=; b=Cff5FNo/KBIIRXQoXYQJxlStCLl4fcScjbks1zdZMGC17TXZ2cROtHSTcc/IQiq6Js pB4rWQapPOPFhPpv1lQralTWR/KQYg3/9UCoTz5TulYMrhvov5EY9b9VyR0tIk8j9Sqg 9i3TxTvVrGrCerGmJKhnHut2dY78qEYuVaUjBMK0cIYOZryB/a7a6/od/N+zV46jwec5 5XU+IVvfx0bgiWdPUoQKCeMDv2wESeotLh9rggl1R9Ki2ZNNeG2p/IQdGL4QykPxGRwT QvY+847o2JNz2aJ8fbZbytgbbhY9ORgw9iwfb8B3TT2L52QpBUytgO5x5JbVvua3Mi3b c5Pg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a170903230100b00158b259cf77si2670369plh.169.2022.05.17.11.12.40; Tue, 17 May 2022 11:12:59 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351628AbiEQRx1 (ORCPT + 99 others); Tue, 17 May 2022 13:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351629AbiEQRxZ (ORCPT ); Tue, 17 May 2022 13:53:25 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CDA43F88C for ; Tue, 17 May 2022 10:53:24 -0700 (PDT) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nr1NS-0000eT-Gd; Tue, 17 May 2022 19:52:58 +0200 Message-ID: <21250bc0-623b-f11d-7dbf-458d144b7963@pengutronix.de> Date: Tue, 17 May 2022 19:52:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 From: Ahmad Fatoum Subject: Re: [PATCH v10 2/7] KEYS: trusted: allow use of kernel RNG for key material To: "Jason A. Donenfeld" 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" , =?UTF-8?Q?Horia_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 References: <20220513145705.2080323-1-a.fatoum@pengutronix.de> <20220513145705.2080323-3-a.fatoum@pengutronix.de> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hello Jason, On 17.05.22 19:27, Jason A. Donenfeld wrote: > 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. The two currently upstream trust sources (trusted key backends) each provide their own RNG callback. This series adds a third backend that uses kernel RNG and additionally provides users of the two existing trust sources the option to benefit from kernel RNG as well. > 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}" The trusted keys module is trusted.ko and directly before my added lines is the trusted.source= documentation, so I think this is already at the correct place. Thanks, Ahmad > > Jason > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |