#include <Library/BaseMemoryLib.h>\r
#include <Library/Tcg2PpVendorLib.h>\r
#include <Library/SmmServicesTableLib.h>\r
+#include <Library/TcgPhysicalPresenceStorageLib.h>\r
\r
EFI_SMM_VARIABLE_PROTOCOL *mTcg2PpSmmVariable;\r
\r
goto EXIT;\r
}\r
\r
- if ((*OperationRequest > TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) &&\r
- (*OperationRequest < TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) ) {\r
+ if (((*OperationRequest > TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) &&\r
+ (*OperationRequest < TCG2_PHYSICAL_PRESENCE_STORAGE_MANAGEMENT_BEGIN))||\r
+ ((*OperationRequest > TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_FALSE) &&\r
+ (*OperationRequest < TCG2_PHYSICAL_PRESENCE_STORAGE_MANAGEMENT_BEGIN))) {\r
//\r
// This command requires UI to prompt user for Auth data.\r
//\r
IN UINT32 OperationRequest\r
)\r
{\r
- EFI_STATUS Status;\r
- UINTN DataSize;\r
- EFI_TCG2_PHYSICAL_PRESENCE PpData;\r
- EFI_TCG2_PHYSICAL_PRESENCE_FLAGS Flags;\r
- BOOLEAN RequestConfirmed;\r
- \r
+ EFI_STATUS Status;\r
+ UINTN DataSize;\r
+ EFI_TCG2_PHYSICAL_PRESENCE PpData;\r
+ EFI_TCG2_PHYSICAL_PRESENCE_FLAGS Flags;\r
+ UINT32 StorageFlags;\r
+ BOOLEAN RequestConfirmed;\r
+\r
DEBUG ((EFI_D_INFO, "[TPM2] GetUserConfirmationStatusFunction, Request = %x\n", OperationRequest));\r
\r
//\r
return TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION;\r
}\r
\r
+ //\r
+ // Get the Physical Presence storage flags\r
+ //\r
+ StorageFlags = TcgPhysicalPresenceStorageLibReturnStorageFlags();\r
+\r
RequestConfirmed = FALSE;\r
\r
switch (OperationRequest) {\r
RequestConfirmed = TRUE;\r
break;\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
if (OperationRequest <= TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) {\r
RequestConfirmed = TRUE;\r