]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: add Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 18 May 2018 12:23:01 +0000 (14:23 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 22 May 2018 14:30:43 +0000 (16:30 +0200)
This NULL library will let us call
Tcg2PhysicalPresenceLibProcessRequest() unconditionally from
BdsPlatform when building without TPM2_ENABLE.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[lersek@redhat.com: replace MdeModulePkg.dec w/ MdePkg.dec]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.c [new file with mode: 0644]
OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf [new file with mode: 0644]
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

diff --git a/OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.c b/OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.c
new file mode 100644 (file)
index 0000000..fa45e36
--- /dev/null
@@ -0,0 +1,27 @@
+/** @file\r
+  NULL Tcg2PhysicalPresenceLib library instance\r
+\r
+  Copyright (c) 2018, Red Hat, Inc.\r
+  Copyright (c) 2013 - 2016, 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/Tcg2PhysicalPresenceLib.h>\r
+\r
+VOID\r
+EFIAPI\r
+Tcg2PhysicalPresenceLibProcessRequest (\r
+  IN      TPM2B_AUTH                     *PlatformAuth  OPTIONAL\r
+  )\r
+{\r
+  //\r
+  // do nothing\r
+  //\r
+}\r
diff --git a/OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf b/OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
new file mode 100644 (file)
index 0000000..85ccd0e
--- /dev/null
@@ -0,0 +1,33 @@
+## @file\r
+#  NULL Tcg2PhysicalPresenceLib library instance\r
+#\r
+# Under SecurityPkg, the corresponding library instance will check and\r
+# execute TPM 2.0 request from OS or BIOS; the request may ask for user\r
+# confirmation before execution. This Null instance implements a no-op\r
+# Tcg2PhysicalPresenceLibProcessRequest(), without user interaction.\r
+#\r
+# Copyright (C) 2018, Red Hat, Inc.\r
+# Copyright (c) 2013 - 2016, 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
+# 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
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = DxeTcg2PhysicalPresenceLibNull\r
+  FILE_GUID                      = 2A6BA243-DC22-42D8-9C3D-AE3728DC7AFA\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = Tcg2PhysicalPresenceLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
+\r
+[Sources]\r
+  DxeTcg2PhysicalPresenceLib.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  SecurityPkg/SecurityPkg.dec\r
index 2d6c4c4615b61c285ef8ea3ef02da876140f0d75..6c361b73cd552cd1af2aee069a73083082a3c4e3 100644 (file)
   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf\r
   Tcg2PhysicalPresenceLib|SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.inf\r
   Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf\r
+!else\r
+  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf\r
 !endif\r
 \r
 [LibraryClasses.common]\r
index 43158c5f062731d454bcb7f77b29e4190d82d20b..62a6075a671d31f847692c67dd72596ddc3432cd 100644 (file)
   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf\r
   Tcg2PhysicalPresenceLib|SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.inf\r
   Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf\r
+!else\r
+  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf\r
 !endif\r
 \r
 [LibraryClasses.common]\r
index d1fdf7c307c287f446da24e5da867acbf6b6f37d..cbab1aa328c6c0ff71704839df45026754bd1262 100644 (file)
   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf\r
   Tcg2PhysicalPresenceLib|SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.inf\r
   Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf\r
+!else\r
+  Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf\r
 !endif\r
 \r
 [LibraryClasses.common]\r