diff options
author | Eric Dong <eric.dong@intel.com> | 2016-11-14 14:47:41 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-11-21 15:37:56 +0800 |
commit | 177dca331f8ebf5cde4d0df14988e47b5fb25877 (patch) | |
tree | 145f48a78f32631c23941cfd669db6a60560f9ca /SecurityPkg/Tcg | |
parent | 509b0fe35807d1a51a8c5bee6321a0ea7e2c17b9 (diff) | |
download | edk2-177dca331f8ebf5cde4d0df14988e47b5fb25877.tar.gz edk2-177dca331f8ebf5cde4d0df14988e47b5fb25877.tar.bz2 edk2-177dca331f8ebf5cde4d0df14988e47b5fb25877.zip |
SecurityPkg TcgSmm: Enable Storage actions.
After enable storage related actions in the
TcgPhysicalPresenceStorageLib, use this library to support
storage related actions in this driver.
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'SecurityPkg/Tcg')
-rw-r--r-- | SecurityPkg/Tcg/TcgSmm/TcgSmm.c | 23 | ||||
-rw-r--r-- | SecurityPkg/Tcg/TcgSmm/TcgSmm.h | 2 | ||||
-rw-r--r-- | SecurityPkg/Tcg/TcgSmm/TcgSmm.inf | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c index 589bab694b..743b3ebbe1 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 21e4ad96d2..148638c20a 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 <PiDxe.h>
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/UefiTcgPlatform.h>
+#include <IndustryStandard/TcgPhysicalPresence.h>
#include <Guid/PhysicalPresenceData.h>
#include <Guid/MemoryOverwriteControl.h>
@@ -37,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/TpmMeasurementLib.h>
#include <Library/PcdLib.h>
#include <Library/TcgPpVendorLib.h>
+#include <Library/TcgPhysicalPresenceStorageLib.h>
#pragma pack(1)
typedef struct {
diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf index be7a96bc62..5f2d3a3779 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"
|