mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
eecad34987
commit
ee46ac08fc
|
@ -267,6 +267,7 @@ Tpm12TisTpmCommand (
|
||||||
UINT32 TpmOutSize;
|
UINT32 TpmOutSize;
|
||||||
UINT16 Data16;
|
UINT16 Data16;
|
||||||
UINT32 Data32;
|
UINT32 Data32;
|
||||||
|
UINT16 RspTag;
|
||||||
|
|
||||||
DEBUG_CODE (
|
DEBUG_CODE (
|
||||||
UINTN DebugSize;
|
UINTN DebugSize;
|
||||||
|
@ -364,11 +365,12 @@ Tpm12TisTpmCommand (
|
||||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
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));
|
CopyMem (&Data16, BufferOut, sizeof (UINT16));
|
||||||
if (SwapBytes16 (Data16) != TPM_TAG_RSP_COMMAND) {
|
RspTag = SwapBytes16 (Data16);
|
||||||
DEBUG ((EFI_D_ERROR, "TPM12: TPM_ST_RSP error - %x\n", TPM_TAG_RSP_COMMAND));
|
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;
|
Status = EFI_UNSUPPORTED;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue