]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
SecurityPkg: Tcg2Smm: Update HID patch logic
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Smm / Tcg2Smm.c
index 2cedfde75329fc2dd0c7317868fb7ab92bf890e8..e8880585449278b5e775d9ea2c6daca163af841e 100644 (file)
@@ -9,7 +9,7 @@
 \r
   PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, 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
@@ -329,7 +329,6 @@ UpdateHID (
   // Initialize HID with Default PNP string\r
   //\r
   ZeroMem(HID, TPM_HID_ACPI_SIZE);\r
-  CopyMem(HID, TPM_HID_TAG, TPM_HID_PNP_SIZE);\r
 \r
   //\r
   // Get Manufacturer ID\r
@@ -389,10 +388,12 @@ UpdateHID (
     if (AsciiStrCmp((CHAR8 *)DataPtr,  TPM_HID_TAG) == 0) {\r
       if (PnpHID) {\r
         CopyMem(DataPtr, HID, TPM_HID_PNP_SIZE);\r
-      } else {\r
         //\r
-        // NOOP will be patched to '\0'\r
+        // if HID is PNP ID, patch the last byte in HID TAG to Noop\r
         //\r
+        *(DataPtr + TPM_HID_PNP_SIZE) = AML_NOOP_OP;\r
+      } else {\r
+\r
         CopyMem(DataPtr, HID, TPM_HID_ACPI_SIZE);\r
       }\r
       DEBUG((EFI_D_INFO, "TPM2 ACPI _HID updated to %a\n", HID));\r