REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2443

Add Tcg2PpVendorLibExecutePendingRequestEx and
Tcg2PpVendorLibSubmitRequestToPreOSFunctionEx to handle the
EFI_TCG2_PHYSICAL_PRESENCE parameters.
Implement in the null version.

Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Jian J Wang <jian.j.w...@intel.com>
Cc: Chao Zhang <chao.b.zh...@intel.com>
Signed-off-by: Zhichao Gao <zhichao....@intel.com>
---
 .../Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.c | 61 ++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.c 
b/SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.c
index 895d05a28d..0b57ba44e3 100644
--- a/SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.c
+++ b/SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.c
@@ -1,7 +1,7 @@
 /** @file
   NULL Tcg2 PP Vendor library instance that does not support any vendor 
specific PPI.
 
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -40,6 +40,37 @@ Tcg2PpVendorLibExecutePendingRequest (
   return TCG_PP_OPERATION_RESPONSE_BIOS_FAILURE;
 }
 
+/**
+  Check and execute the requested physical presence command.
+
+  This API should be invoked in BIOS boot phase to process pending request.
+
+  Caution: This function may receive untrusted input.
+
+  If OperationRequest < 128, then ASSERT().
+
+  @param[in]      PlatformAuth     platform auth value. NULL means no platform 
auth change.
+  @param[in]      PPData           Ptr to EFI_TCG2_PHYSICAL_PRESENCE data.
+  @param[in, out] ManagementFlags  BIOS TPM Management Flags.
+  @param[out]     ResetRequired    If reset is required to vendor settings in 
effect.
+                                   True, it indicates the reset is required.
+                                   False, it indicates the reset is not 
required.
+
+  @return TPM Operation Response to OS Environment.
+**/
+UINT32
+EFIAPI
+Tcg2PpVendorLibExecutePendingRequestEx (
+  IN TPM2B_AUTH                 *PlatformAuth,  OPTIONAL
+  IN EFI_TCG2_PHYSICAL_PRESENCE *PPData,
+  IN OUT UINT32                 *ManagementFlags,
+  OUT BOOLEAN                   *ResetRequired
+  )
+{
+  ASSERT (PPData->PPRequest >= 
TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
+  return TCG_PP_OPERATION_RESPONSE_BIOS_FAILURE;
+}
+
 /**
   Check if there is a valid physical presence command request.
 
@@ -100,6 +131,34 @@ Tcg2PpVendorLibSubmitRequestToPreOSFunction (
   return TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED;
 }
 
+/**
+  The callback for TPM vendor specific physical presence which is called for
+  Submit TPM Operation Request to Pre-OS Environment and
+  Submit TPM Operation Request to Pre-OS Environment 2.
+
+  This API should be invoked in OS runtime phase to interface with ACPI method.
+
+  Caution: This function may receive untrusted input.
+
+  If OperationRequest < 128, then ASSERT().
+
+  @param[in]      *PPData          Ptr to EFI_TCG2_PHYSICAL_PRESENCE data.
+  @param[in]      ManagementFlags  BIOS TPM Management Flags.
+
+  @return Return Code for Submit TPM Operation Request to Pre-OS Environment 
and
+          Submit TPM Operation Request to Pre-OS Environment 2.
+**/
+UINT32
+EFIAPI
+Tcg2PpVendorLibSubmitRequestToPreOSFunctionEx (
+  IN EFI_TCG2_PHYSICAL_PRESENCE   *PPdata,
+  IN UINT32                       ManagementFlags
+  )
+{
+  ASSERT (PPdata->PPRequest >= 
TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
+  return TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED;
+}
+
 /**
   The callback for TPM vendor specific physical presence which is called for
   Get User Confirmation Status for Operation.
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52709): https://edk2.groups.io/g/devel/message/52709
Mute This Topic: https://groups.io/mt/69392329/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to