From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AEA9A81EEA for ; Tue, 15 Nov 2016 22:01:29 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 15 Nov 2016 22:01:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,646,1473145200"; d="scan'208";a="1085863552" Received: from shwde7156.ccr.corp.intel.com ([10.239.158.52]) by fmsmga002.fm.intel.com with ESMTP; 15 Nov 2016 22:01:33 -0800 From: Eric Dong To: edk2-devel@lists.01.org Cc: Jiewen Yao , Chao Zhang Date: Wed, 16 Nov 2016 14:00:47 +0800 Message-Id: <1479276049-34308-9-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.6.4.windows.1 In-Reply-To: <1479276049-34308-1-git-send-email-eric.dong@intel.com> References: <1479276049-34308-1-git-send-email-eric.dong@intel.com> Subject: [Patch 08/10] SecurityPkg TcgSmm: Enable Storage actions. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 06:01:29 -0000 After enable storage related actions in the TcgPhysicalPresenceStorageLib, use this library to support storage related actions in this driver. Cc: Jiewen Yao Cc: Chao Zhang Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong --- SecurityPkg/Tcg/TcgSmm/TcgSmm.c | 23 +++++++++++++++++++++++ SecurityPkg/Tcg/TcgSmm/TcgSmm.h | 2 ++ SecurityPkg/Tcg/TcgSmm/TcgSmm.inf | 1 + 3 files changed, 26 insertions(+) diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c index 589bab6..743b3eb 100644 --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c @@ -55,6 +55,7 @@ PhysicalPresenceCallback ( EFI_PHYSICAL_PRESENCE PpData; EFI_PHYSICAL_PRESENCE_FLAGS Flags; BOOLEAN RequestConfirmed; + UINT32 StorageFlags; // // Get the Physical Presence variable @@ -150,6 +151,11 @@ PhysicalPresenceCallback ( return EFI_SUCCESS; } + // + // Get the Physical Presence storage flags + // + StorageFlags = TcgPhysicalPresenceStorageLibReturnStorageFlags(); + RequestConfirmed = FALSE; switch (mTcgNvs->PPRequestUserConfirm) { @@ -201,6 +207,23 @@ PhysicalPresenceCallback ( // mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED; return EFI_SUCCESS; + + case TCG2_PHYSICAL_PRESENCE_ENABLE_BLOCK_SID: + if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID) == 0) { + RequestConfirmed = TRUE; + } + break; + + case TCG2_PHYSICAL_PRESENCE_DISABLE_BLOCK_SID: + if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID) == 0) { + RequestConfirmed = TRUE; + } + break; + + case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_ENABLE_BLOCK_SID_FUNC_TRUE: + case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_TRUE: + break; + default: break; } diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.h b/SecurityPkg/Tcg/TcgSmm/TcgSmm.h index 21e4ad9..148638c 100644 --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.h +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.h @@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include @@ -37,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #pragma pack(1) typedef struct { diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf index be7a96b..5f2d3a3 100644 --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf @@ -50,6 +50,7 @@ TpmMeasurementLib PcdLib TcgPpVendorLib + TcgPhysicalPresenceStorageLib [Guids] ## SOMETIMES_PRODUCES ## Variable:L"PhysicalPresence" -- 2.6.4.windows.1