From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8A780D80696 for ; Tue, 18 Jul 2023 11:52:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=MezzfD4XE8olxbwwbnD0fQUvZfo1g9XCvZCaEBOGK7Q=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1689681164; v=1; b=a2ZQnCuxCvefpX5iCKj3VxOgy517Tsqa6W1rkaJm/0sId9ASkRN0LDeq6jFNgeuanOLwHTx1 jqfqDMwC6fSsrrusktrfXGosWyETscfPEifT1Ylx0m5PeO7t/B5wDOxeYGm5hQw9tOpPixWbYjq ulczNRpfcF1ra4SVZrN/MEyk= X-Received: by 127.0.0.2 with SMTP id zBzHYY7687511xG74kP8AF3p; Tue, 18 Jul 2023 04:52:44 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5681.1689681163652479730 for ; Tue, 18 Jul 2023 04:52:43 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D090F13D5; Tue, 18 Jul 2023 04:53:26 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CF86A3F6C4; Tue, 18 Jul 2023 04:52:41 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao , Jian J Wang , Ard Biesheuvel , Sami Mujawar , Jose Marinho , Kun Qin Subject: [edk2-devel] [PATCH v5 6/9] MdeModulePkg/Rng: Add GUID to describe unsafe Rng algorithms Date: Tue, 18 Jul 2023 13:51:53 +0200 Message-Id: <20230718115156.1224842-7-pierre.gondois@arm.com> In-Reply-To: <20230718115156.1224842-1-pierre.gondois@arm.com> References: <20230718115156.1224842-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: 5ZM7CoY4liS7WDCLYhZ4u7EOx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=a2ZQnCux; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) From: Pierre Gondois BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4441 The EFI_RNG_PROTOCOL can rely on the RngLib. The RngLib has multiple implementations, some of them are unsafe (e.g. BaseRngLibTimerLib). To allow the RngDxe to detect when such implementation is used, a GetRngGuid() function is added in a following patch. Prepare GetRngGuid() return values and add a gEdkiiRngAlgorithmUnSafe to describe an unsafe implementation, cf. the BaseRngLibTimerLib. Signed-off-by: Pierre Gondois --- MdeModulePkg/Include/Guid/RngAlgorithm.h | 23 +++++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 MdeModulePkg/Include/Guid/RngAlgorithm.h diff --git a/MdeModulePkg/Include/Guid/RngAlgorithm.h b/MdeModulePkg/Incl= ude/Guid/RngAlgorithm.h new file mode 100644 index 000000000000..e2ac2ba3e5c6 --- /dev/null +++ b/MdeModulePkg/Include/Guid/RngAlgorithm.h @@ -0,0 +1,23 @@ +/** @file + Rng Algorithm + + Copyright (c) 2023, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef RNG_ALGORITHM_GUID_H_ +#define RNG_ALGORITHM_GUID_H_ + +/// +/// The implementation of a Random Number Generator might be unsafe, whe= n using +/// a dummy implementation for instance. Allow identifying such implemen= tation +/// with this GUID. +/// +#define EDKII_RNG_ALGORITHM_UNSAFE \ + { \ + 0x869f728c, 0x409d, 0x4ab4, {0xac, 0x03, 0x71, 0xd3, 0x09, 0xc1, 0xb= 3, 0xf4 } \ + } + +extern EFI_GUID gEdkiiRngAlgorithmUnSafe; + +#endif // #ifndef RNG_ALGORITHM_GUID_H_ diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.de= c index d65dae18aa81..55617c3f9bd2 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -418,6 +418,9 @@ [Guids] ## Include/Guid/MigratedFvInfo.h gEdkiiMigratedFvInfoGuid =3D { 0xc1ab12f7, 0x74aa, 0x408d, { 0xa2, 0xf= 4, 0xc6, 0xce, 0xfd, 0x17, 0x98, 0x71 } } =20 + ## Include/Guid/RngAlgorithm.h + gEdkiiRngAlgorithmUnSafe =3D { 0x869f728c, 0x409d, 0x4ab4, {0xac, 0x03= , 0x71, 0xd3, 0x09, 0xc1, 0xb3, 0xf4 }} + # # GUID defined in UniversalPayload # --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107013): https://edk2.groups.io/g/devel/message/107013 Mute This Topic: https://groups.io/mt/100213734/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-