]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
SecurityPkg : Tpm12DeviceLibDTpm: Fix TPM12 wrong Response Tag check
[mirror_edk2.git] / SecurityPkg / Library / Tpm12DeviceLibDTpm / Tpm12Tis.c
index 4e04299f2396b0993639d597a4f58be5a936db3e..c392b4b2150e8a63c16b436c78334ad50e8eacce 100644 (file)
@@ -267,6 +267,7 @@ Tpm12TisTpmCommand (
   UINT32                            TpmOutSize;\r
   UINT16                            Data16;\r
   UINT32                            Data32;\r
+  UINT16                            RspTag;\r
 \r
   DEBUG_CODE (\r
     UINTN  DebugSize;\r
@@ -364,11 +365,12 @@ Tpm12TisTpmCommand (
     DEBUG ((EFI_D_VERBOSE, "\n"));\r
   );\r
   //\r
-  // Check the reponse data header (tag,parasize and returncode )\r
+  // Check the response data header (tag, parasize and returncode)\r
   //\r
   CopyMem (&Data16, BufferOut, sizeof (UINT16));\r
-  if (SwapBytes16 (Data16) != TPM_TAG_RSP_COMMAND) {\r
-    DEBUG ((EFI_D_ERROR, "TPM12: TPM_ST_RSP error - %x\n", TPM_TAG_RSP_COMMAND));\r
+  RspTag = SwapBytes16 (Data16);\r
+  if (RspTag != TPM_TAG_RSP_COMMAND && RspTag != TPM_TAG_RSP_AUTH1_COMMAND && RspTag != TPM_TAG_RSP_AUTH2_COMMAND) {\r
+    DEBUG ((EFI_D_ERROR, "TPM12: Response tag error - current tag value is %x\n", RspTag));\r
     Status = EFI_UNSUPPORTED;\r
     goto Exit;\r
   }\r