#include <Library/Tpm2CommandLib.h>\r
#include <Library/Tcg2PhysicalPresenceLib.h>\r
#include <Library/Tcg2PpVendorLib.h>\r
+#include <Library/TcgPhysicalPresenceStorageLib.h>\r
\r
#define CONFIRM_BUFFER_SIZE 4096\r
\r
EDKII_VARIABLE_LOCK_PROTOCOL *VariableLockProtocol;\r
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;\r
\r
+ //\r
+ // Process the storage related action first.\r
+ //\r
+ TcgPhysicalPresenceStorageLibProcessRequest();\r
+\r
Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);\r
if (EFI_ERROR (Status)) {\r
return ;\r
EFI_TCG2_PROTOCOL *Tcg2Protocol;\r
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;\r
\r
+ //\r
+ // Process the storage related action first.\r
+ // If confirm need user confirm, just return TRUE.\r
+ // else continue check other actions.\r
+ //\r
+ if (TcgPhysicalPresenceStorageLibNeedUserConfirm()) {\r
+ return TRUE;\r
+ }\r
+\r
Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);\r
if (EFI_ERROR (Status)) {\r
return FALSE;\r
UINTN DataSize;\r
EFI_TCG2_PHYSICAL_PRESENCE PpData;\r
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS Flags;\r
- \r
+\r
DEBUG ((EFI_D_INFO, "[TPM2] SubmitRequestToPreOSFunction, Request = %x, %x\n", OperationRequest, RequestParameter));\r
- \r
+\r
//\r
// Get the Physical Presence variable\r
//\r
return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;\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_VENDOR_SPECIFIC_OPERATION))) {\r
//\r
// This command requires UI to prompt user for Auth data.\r
//\r