]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/TrEEPpVendorLibNull/TrEEPpVendorLibNull.c
Add TPM Physical Presence >=128 operation value support.
[mirror_edk2.git] / SecurityPkg / Library / TrEEPpVendorLibNull / TrEEPpVendorLibNull.c
diff --git a/SecurityPkg/Library/TrEEPpVendorLibNull/TrEEPpVendorLibNull.c b/SecurityPkg/Library/TrEEPpVendorLibNull/TrEEPpVendorLibNull.c
new file mode 100644 (file)
index 0000000..efd477a
--- /dev/null
@@ -0,0 +1,131 @@
+/** @file\r
+  NULL TrEE PP Vendor library instance that does not support any vendor specific PPI.\r
+\r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution.  The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/TrEEPpVendorLib.h>\r
+\r
+/**\r
+  Check and execute the requested physical presence command.\r
+\r
+  This API should be invoked in BIOS boot phase to process pending request.\r
+  \r
+  Caution: This function may receive untrusted input.\r
+  \r
+  If OperationRequest < 128, then ASSERT().\r
+\r
+  @param[in]      PlatformAuth     platform auth value. NULL means no platform auth change.\r
+  @param[in]      OperationRequest TPM physical presence operation request.\r
+  @param[in, out] ManagementFlags  BIOS TPM Management Flags.\r
+  @param[out]     ResetRequired    If reset is required to vendor settings in effect.\r
+                                   True, it indicates the reset is required.\r
+                                   False, it indicates the reset is not required.\r
+\r
+  @return TPM Operation Response to OS Environment.\r
+**/\r
+UINT32\r
+EFIAPI\r
+TrEEPpVendorLibExecutePendingRequest (\r
+  IN TPM2B_AUTH             *PlatformAuth,  OPTIONAL\r
+  IN UINT32                 OperationRequest,\r
+  IN OUT UINT32             *ManagementFlags,\r
+  OUT BOOLEAN               *ResetRequired\r
+  )\r
+{\r
+  ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
+  return TREE_PP_OPERATION_RESPONSE_BIOS_FAILURE;\r
+}\r
+\r
+/**\r
+  Check if there is a valid physical presence command request.\r
+\r
+  This API should be invoked in BIOS boot phase to process pending request.\r
+  \r
+  Caution: This function may receive untrusted input.\r
+\r
+  If OperationRequest < 128, then ASSERT().\r
+\r
+  @param[in]      OperationRequest TPM physical presence operation request.\r
+  @param[in]      ManagementFlags  BIOS TPM Management Flags.\r
+  @param[out]     RequestConfirmed If the physical presence operation command required user confirm from UI.\r
+                                   True, it indicates the command doesn't require user confirm.\r
+                                   False, it indicates the command need user confirm from UI.\r
+\r
+  @retval  TRUE        Physical Presence operation command is valid.\r
+  @retval  FALSE       Physical Presence operation command is invalid.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+TrEEPpVendorLibHasValidRequest (\r
+  IN UINT32                 OperationRequest,\r
+  IN UINT32                 ManagementFlags,\r
+  OUT BOOLEAN               *RequestConfirmed\r
+  )\r
+{\r
+  ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+  The callback for TPM vendor specific physical presence which is called for\r
+  Submit TPM Operation Request to Pre-OS Environment and\r
+  Submit TPM Operation Request to Pre-OS Environment 2.\r
+\r
+  This API should be invoked in OS runtime phase to interface with ACPI method.\r
+\r
+  Caution: This function may receive untrusted input.\r
+  \r
+  If OperationRequest < 128, then ASSERT().\r
+\r
+  @param[in]      OperationRequest TPM physical presence operation request.\r
+  @param[in]      ManagementFlags  BIOS TPM Management Flags.\r
+\r
+  @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r
+          Submit TPM Operation Request to Pre-OS Environment 2.\r
+**/\r
+UINT32\r
+EFIAPI\r
+TrEEPpVendorLibSubmitRequestToPreOSFunction (\r
+  IN UINT32                 OperationRequest,\r
+  IN UINT32                 ManagementFlags\r
+  )\r
+{\r
+  ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
+  return TREE_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED;\r
+}\r
+\r
+/**\r
+  The callback for TPM vendor specific physical presence which is called for\r
+  Get User Confirmation Status for Operation.\r
+\r
+  This API should be invoked in OS runtime phase to interface with ACPI method.\r
+\r
+  Caution: This function may receive untrusted input.\r
+  \r
+  If OperationRequest < 128, then ASSERT().\r
+\r
+  @param[in]      OperationRequest TPM physical presence operation request.\r
+  @param[in]      ManagementFlags  BIOS TPM Management Flags.\r
+\r
+  @return Return Code for Get User Confirmation Status for Operation.\r
+**/\r
+UINT32\r
+EFIAPI\r
+TrEEPpVendorLibGetUserConfirmationStatusFunction (\r
+  IN UINT32                 OperationRequest,\r
+  IN UINT32                 ManagementFlags\r
+  )\r
+{\r
+  ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
+  return TREE_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED;\r
+}\r