SecurityPkg: Tcg2ConfigDxe/Tcg2Smm: Fix TPM2 HID issue
authorZhang, Chao B <chao.b.zhang@intel.com>
Tue, 10 Jan 2017 06:53:08 +0000 (14:53 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Tue, 10 Jan 2017 07:16:46 +0000 (15:16 +0800)
Fix wrong TPM2 HID generation logic.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c

index a83000f..b3a849e 100644 (file)
@@ -441,9 +441,9 @@ GetTpm2HID(
     //   #### is Firmware Version 1\r
     //\r
     if (PnpHID) {\r
-      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));\r
+      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF));\r
     } else {\r
-      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));\r
+      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF));\r
     }\r
 \r
   } else {\r
index fa0b6e6..1df2da8 100644 (file)
@@ -369,9 +369,9 @@ UpdateHID (
     //   #### is Firmware Version 1\r
     //\r
     if (PnpHID) {\r
-      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));\r
+      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF));\r
     } else {\r
-      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));\r
+      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF));\r
     }\r
     \r
   } else {\r