SecurityPkg: TPM12CommandLib: Add Response returnCode Check

Check response return code before return from Tpm12Extend and
Tpm12PhysicalPresence.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
This commit is contained in:
Zhang, Chao B
2016-08-31 09:26:08 +08:00
parent 6c59c7c2f4
commit 950a3bc788
2 changed files with 18 additions and 1 deletions

View File

@@ -74,6 +74,11 @@ Tpm12Extend (
return Status;
}
if (SwapBytes32(Response.Hdr.returnCode) != TPM_SUCCESS) {
DEBUG ((EFI_D_ERROR, "Tpm12Extend: Response Code error! 0x%08x\r\n", SwapBytes32(Response.Hdr.returnCode)));
return EFI_DEVICE_ERROR;
}
if (NewPcrValue != NULL) {
CopyMem (NewPcrValue, &Response.TpmDigest, sizeof (*NewPcrValue));
}