From nobody Tue Feb 10 01:20:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55786+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55786+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1583992348; cv=none; d=zohomail.com; s=zohoarc; b=IAuYP3hmODxLTkpUF2vCONvV03vMA/Ye+z5DP/dsBrqBuh/R/H/x/RcJQHyBPFILVz9QHud22jzsTleoyIIYt15HELL/m4XBDf6c+DdH9CLsJIe/y/xGq+mSnIOAjaRnKwEGsjUO4gpmX4+3BAbkJ+5otxZjVCRSNH0Mr/COd+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583992348; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=h13q1oWz/gAW2ZsDKPeHysPFtg+ymW9ApzmIA2Kvj+8=; b=eIpPERJjdHWg00tu1UVafEtlz2C30w2TIjJRA/LNRtmE5W/QRC3RyjlK2rlxSWfFdLG2ECMnTd1lBIe9gXaWVMWAbAGaGfKWGwyh18Lvol2HCraBjqcSXcnhx32fzLs1DeBJSGodw7VX9VLygUjidNgyg/KAEjNsGsxCqzaD39s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55786+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583992348339366.60751821596796; Wed, 11 Mar 2020 22:52:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Ki0SYY1788612xrWZIsvqn4b; Wed, 11 Mar 2020 22:52:26 -0700 X-Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web11.4405.1583992343621109277 for ; Wed, 11 Mar 2020 22:52:26 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 22:52:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,543,1574150400"; d="scan'208";a="236706544" X-Received: from shwdeopensfp777.ccr.corp.intel.com ([10.239.158.78]) by orsmga008.jf.intel.com with ESMTP; 11 Mar 2020 22:52:24 -0700 From: "Wang, Jian J" To: devel@edk2.groups.io Cc: Jiewen Yao , Chao Zhang , Nishant C Mistry Subject: [edk2-devel] [PATCH 2/3] SecurityPkg: add null version of RpmcLib Date: Thu, 12 Mar 2020 13:52:20 +0800 Message-Id: <20200312055221.1781-3-jian.j.wang@intel.com> In-Reply-To: <20200312055221.1781-1-jian.j.wang@intel.com> References: <20200312055221.1781-1-jian.j.wang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,jian.j.wang@intel.com X-Gm-Message-State: Vlj1LFG5Oim1Ssl2pWev4SYdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1583992346; bh=xo20rwQjU7sY77oCzowC9dpyHyh21Ao7ftuEkdFoQGo=; h=Cc:Date:From:Reply-To:Subject:To; b=jIqbPsTHLjzjLeJvZg+1Q7tb0uB7vT7m61+ZWiYZtiS2XwO8tYZGejs2cf2O33HBnAU IoRddLtb0+rxL8rv4e1xAo5UaIfPYTdwhtJqNMPqLNsVACvlUisF+cylPEqnz3lYncPIl nN4ePNs9MF74ReF37mVaAhEAqFzk9iHAf7U= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2594 Add null version of RpmcLib instance. The full version should be provided by platform which supports RPMC device. Cc: Jiewen Yao Cc: Chao Zhang Cc: Nishant C Mistry Signed-off-by: Jian J Wang --- SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c | 55 +++++++++++++++++++ .../Library/RpmcLibNull/RpmcLibNull.inf | 33 +++++++++++ SecurityPkg/SecurityPkg.dsc | 6 ++ 3 files changed, 94 insertions(+) create mode 100644 SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c create mode 100644 SecurityPkg/Library/RpmcLibNull/RpmcLibNull.inf diff --git a/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c b/SecurityPkg/Li= brary/RpmcLibNull/RpmcLibNull.c new file mode 100644 index 0000000000..586590c65f --- /dev/null +++ b/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c @@ -0,0 +1,55 @@ +/** @file + NULL RpmcLib instance for build purpose. + +Copyright (c) 2020, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + Requests the current monotonic counter from the designated RPMC counter. + + @param[in] CounterIndex The RPMC index. + @param[out] CounterValue A pointer to a buffer to store the= RPMC value. + + @retval EFI_SUCCESS The operation completed successful= ly. + @retval EFI_INVALID_PARAMETER The CounterValue pointer is NULL o= r CounterIndex is invalid. + @retval EFI_NOT_READY The given RPMC at CounterIndex is = not yet initialized. + @retval EFI_DEVICE_ERROR A device error occurred while atte= mpting to update the counter. + @retval EFI_UNSUPPORTED Requesting the monotonic counter i= s not supported in the current boot configuration. +**/ +EFI_STATUS +EFIAPI +RequestMonotonicCounter ( + IN UINT8 CounterIndex, + OUT UINT32 *CounterValue + ) +{ + ASSERT (FALSE); + return EFI_UNSUPPORTED; +} + +/** + Increments the designated monotonic counter in the SPI flash device by 1. + + @param[in] CounterIndex The RPMC index. + + @retval EFI_SUCCESS The operation completed successful= ly. + @retval EFI_INVALID_PARAMETER The given CounterIndex value is in= valid. + @retval EFI_NOT_READY The given RPMC at CounterIndex is = not yet initialized. + @retval EFI_DEVICE_ERROR A device error occurred while atte= mpting to update the counter. + @retval EFI_UNSUPPORTED Incrementing the monotonic counter= is not supported in the current boot configuration. +**/ +EFI_STATUS +EFIAPI +IncrementMonotonicCounter ( + IN UINT8 CounterIndex + ) +{ + ASSERT (FALSE); + return EFI_UNSUPPORTED; +} + diff --git a/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.inf b/SecurityPkg/= Library/RpmcLibNull/RpmcLibNull.inf new file mode 100644 index 0000000000..500edfa87d --- /dev/null +++ b/SecurityPkg/Library/RpmcLibNull/RpmcLibNull.inf @@ -0,0 +1,33 @@ +## @file +# Provides Null version of RpmcLib for build purpose. +# +# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010029 + BASE_NAME =3D RpmcLibNull + FILE_GUID =3D FAE0BA22-92E2-4334-8F0F-96AFF9BAE360 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RpmcLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 Arm AArch64 +# + +[Sources] + RpmcLibNull.c + +[Packages] + MdePkg/MdePkg.dec + SecurityPkg/SecurityPkg.dec + +[LibraryClasses] + BaseLib + DebugLib + diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc index a2eeadda7a..97e0e7ed6e 100644 --- a/SecurityPkg/SecurityPkg.dsc +++ b/SecurityPkg/SecurityPkg.dsc @@ -64,6 +64,7 @@ TcgStorageCoreLib|SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCoreLi= b.inf TcgStorageOpalLib|SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalLi= b.inf ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSyst= emLibNull.inf + RpmcLib|SecurityPkg/Library/RpmcLibNull/RpmcLibNull.inf =20 [LibraryClasses.ARM] # @@ -217,6 +218,11 @@ SecurityPkg/Library/TcgStorageCoreLib/TcgStorageCoreLib.inf SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalLib.inf =20 + # + # Variable Confidentiality & Integrity + # + SecurityPkg/Library/RpmcLibNull/RpmcLibNull.inf + # # Other # --=20 2.24.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55786): https://edk2.groups.io/g/devel/message/55786 Mute This Topic: https://groups.io/mt/71896823/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-