]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg TcgSmm: Enable Storage actions.
authorEric Dong <eric.dong@intel.com>
Mon, 14 Nov 2016 06:47:41 +0000 (14:47 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 21 Nov 2016 07:37:56 +0000 (15:37 +0800)
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>
SecurityPkg/Tcg/TcgSmm/TcgSmm.c
SecurityPkg/Tcg/TcgSmm/TcgSmm.h
SecurityPkg/Tcg/TcgSmm/TcgSmm.inf

index 589bab694b3ad4affbb6aa0bbf322d21653f910e..743b3ebbe1b1182b32a7e6c6005183ea3c21a026 100644 (file)
@@ -55,6 +55,7 @@ PhysicalPresenceCallback (
   EFI_PHYSICAL_PRESENCE          PpData;\r
   EFI_PHYSICAL_PRESENCE_FLAGS    Flags;\r
   BOOLEAN                        RequestConfirmed;\r
+  UINT32                         StorageFlags;\r
 \r
   //\r
   // Get the Physical Presence variable\r
@@ -150,6 +151,11 @@ PhysicalPresenceCallback (
       return EFI_SUCCESS;\r
     }\r
 \r
+    //\r
+    // Get the Physical Presence storage flags\r
+    //\r
+    StorageFlags = TcgPhysicalPresenceStorageLibReturnStorageFlags();\r
+\r
     RequestConfirmed = FALSE;\r
 \r
     switch (mTcgNvs->PPRequestUserConfirm) {\r
@@ -201,6 +207,23 @@ PhysicalPresenceCallback (
         //\r
         mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED; \r
         return EFI_SUCCESS;\r
+\r
+      case TCG2_PHYSICAL_PRESENCE_ENABLE_BLOCK_SID:\r
+        if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID) == 0) {\r
+          RequestConfirmed = TRUE;\r
+        }\r
+        break;\r
+\r
+      case TCG2_PHYSICAL_PRESENCE_DISABLE_BLOCK_SID:\r
+        if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID) == 0) {\r
+          RequestConfirmed = TRUE;\r
+        }\r
+        break;\r
+\r
+      case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_ENABLE_BLOCK_SID_FUNC_TRUE:\r
+      case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_TRUE:\r
+        break;\r
+\r
       default:\r
         break;\r
     }\r
index 21e4ad96d2bd7220a0a13fbc983b6739d10991a1..148638c20af07b95a4546f9e28aac1f407208466 100644 (file)
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <PiDxe.h>\r
 #include <IndustryStandard/Acpi.h>\r
 #include <IndustryStandard/UefiTcgPlatform.h>\r
+#include <IndustryStandard/TcgPhysicalPresence.h>\r
 \r
 #include <Guid/PhysicalPresenceData.h>\r
 #include <Guid/MemoryOverwriteControl.h>\r
@@ -37,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/TpmMeasurementLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/TcgPpVendorLib.h>\r
+#include <Library/TcgPhysicalPresenceStorageLib.h>\r
 \r
 #pragma pack(1)\r
 typedef struct {\r
index be7a96bc62d7401b2d5c72cfdd23b535a5341aac..5f2d3a3779125e366638c96ed2a35a3e32f77dab 100644 (file)
@@ -50,6 +50,7 @@
   TpmMeasurementLib\r
   PcdLib\r
   TcgPpVendorLib\r
+  TcgPhysicalPresenceStorageLib\r
 \r
 [Guids]\r
   ## SOMETIMES_PRODUCES ## Variable:L"PhysicalPresence"\r