diff options
author | Zhang, Chao B <chao.b.zhang@intel.com> | 2016-06-07 10:15:07 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2016-06-08 15:14:56 +0800 |
commit | ee46ac08fc60b00543819899c6b84e99aa60c4bd (patch) | |
tree | 6c90dbd10704f6559276ba6b631fc2f6e22452cd /SecurityPkg | |
parent | eecad34987c56317f69d4eee9d9c1df0c825a79e (diff) | |
download | edk2-ee46ac08fc60b00543819899c6b84e99aa60c4bd.tar.gz edk2-ee46ac08fc60b00543819899c6b84e99aa60c4bd.tar.bz2 edk2-ee46ac08fc60b00543819899c6b84e99aa60c4bd.zip |
SecurityPkg : Tpm12DeviceLibDTpm: Fix TPM12 wrong Response Tag check
TcgDxePassThroughToTpm should be able to handle all TPM12 Command & Response correctly.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r-- | SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c index 4e04299f23..c392b4b215 100644 --- a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c +++ b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c @@ -267,6 +267,7 @@ Tpm12TisTpmCommand ( UINT32 TpmOutSize;
UINT16 Data16;
UINT32 Data32;
+ UINT16 RspTag;
DEBUG_CODE (
UINTN DebugSize;
@@ -364,11 +365,12 @@ Tpm12TisTpmCommand ( DEBUG ((EFI_D_VERBOSE, "\n"));
);
//
- // Check the reponse data header (tag,parasize and returncode )
+ // Check the response data header (tag, parasize and returncode)
//
CopyMem (&Data16, BufferOut, sizeof (UINT16));
- if (SwapBytes16 (Data16) != TPM_TAG_RSP_COMMAND) {
- DEBUG ((EFI_D_ERROR, "TPM12: TPM_ST_RSP error - %x\n", TPM_TAG_RSP_COMMAND));
+ RspTag = SwapBytes16 (Data16);
+ if (RspTag != TPM_TAG_RSP_COMMAND && RspTag != TPM_TAG_RSP_AUTH1_COMMAND && RspTag != TPM_TAG_RSP_AUTH2_COMMAND) {
+ DEBUG ((EFI_D_ERROR, "TPM12: Response tag error - current tag value is %x\n", RspTag));
Status = EFI_UNSUPPORTED;
goto Exit;
}
|