SecurityPkg DxeTcg2PhysicalPresenceLib: Enable Storage actions.
After enable storage related actions in the TcgPhysicalPresenceStorageLib, use this library to support storage related actions in this library. 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>
This commit is contained in:
parent
63556485ed
commit
d6b02b79b0
@ -37,6 +37,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Library/Tpm2CommandLib.h>
|
#include <Library/Tpm2CommandLib.h>
|
||||||
#include <Library/Tcg2PhysicalPresenceLib.h>
|
#include <Library/Tcg2PhysicalPresenceLib.h>
|
||||||
#include <Library/Tcg2PpVendorLib.h>
|
#include <Library/Tcg2PpVendorLib.h>
|
||||||
|
#include <Library/TcgPhysicalPresenceStorageLib.h>
|
||||||
|
|
||||||
#define CONFIRM_BUFFER_SIZE 4096
|
#define CONFIRM_BUFFER_SIZE 4096
|
||||||
|
|
||||||
@ -790,6 +791,11 @@ Tcg2PhysicalPresenceLibProcessRequest (
|
|||||||
EDKII_VARIABLE_LOCK_PROTOCOL *VariableLockProtocol;
|
EDKII_VARIABLE_LOCK_PROTOCOL *VariableLockProtocol;
|
||||||
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;
|
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Process the storage related action first.
|
||||||
|
//
|
||||||
|
TcgPhysicalPresenceStorageLibProcessRequest();
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);
|
Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return ;
|
return ;
|
||||||
@ -910,6 +916,15 @@ Tcg2PhysicalPresenceLibNeedUserConfirm(
|
|||||||
EFI_TCG2_PROTOCOL *Tcg2Protocol;
|
EFI_TCG2_PROTOCOL *Tcg2Protocol;
|
||||||
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;
|
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Process the storage related action first.
|
||||||
|
// If confirm need user confirm, just return TRUE.
|
||||||
|
// else continue check other actions.
|
||||||
|
//
|
||||||
|
if (TcgPhysicalPresenceStorageLibNeedUserConfirm()) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);
|
Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1045,9 +1060,9 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (
|
|||||||
UINTN DataSize;
|
UINTN DataSize;
|
||||||
EFI_TCG2_PHYSICAL_PRESENCE PpData;
|
EFI_TCG2_PHYSICAL_PRESENCE PpData;
|
||||||
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS Flags;
|
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS Flags;
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "[TPM2] SubmitRequestToPreOSFunction, Request = %x, %x\n", OperationRequest, RequestParameter));
|
DEBUG ((EFI_D_INFO, "[TPM2] SubmitRequestToPreOSFunction, Request = %x, %x\n", OperationRequest, RequestParameter));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the Physical Presence variable
|
// Get the Physical Presence variable
|
||||||
//
|
//
|
||||||
@ -1064,8 +1079,10 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (
|
|||||||
return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;
|
return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OperationRequest > TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) &&
|
if (((OperationRequest > TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) &&
|
||||||
(OperationRequest < TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) ) {
|
(OperationRequest < TCG2_PHYSICAL_PRESENCE_STORAGE_MANAGEMENT_BEGIN)) ||
|
||||||
|
((OperationRequest > TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_FALSE) &&
|
||||||
|
(OperationRequest < TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION))) {
|
||||||
//
|
//
|
||||||
// This command requires UI to prompt user for Auth data.
|
// This command requires UI to prompt user for Auth data.
|
||||||
//
|
//
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
HobLib
|
HobLib
|
||||||
Tpm2CommandLib
|
Tpm2CommandLib
|
||||||
Tcg2PpVendorLib
|
Tcg2PpVendorLib
|
||||||
|
TcgPhysicalPresenceStorageLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES
|
gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user