summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c
diff options
context:
space:
mode:
authorZhang, Chao B <chao.b.zhang@intel.com>2016-08-31 09:26:08 +0800
committerZhang, Chao B <chao.b.zhang@intel.com>2016-09-01 14:50:44 +0800
commit950a3bc788b5b101729b26aed3ff75fd2a64a570 (patch)
treee35958416445e9313320c80f12fcf88826c05f7f /SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c
parent6c59c7c2f488d7c9b951b5ead780f6102dafae8a (diff)
downloadedk2-950a3bc788b5b101729b26aed3ff75fd2a64a570.tar.gz
edk2-950a3bc788b5b101729b26aed3ff75fd2a64a570.tar.bz2
edk2-950a3bc788b5b101729b26aed3ff75fd2a64a570.zip
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>
Diffstat (limited to 'SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c')
-rw-r--r--SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c b/SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c
index 321653fb60..18d5b96e6f 100644
--- a/SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c
+++ b/SecurityPkg/Library/Tpm12CommandLib/Tpm12Pcr.c
@@ -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));
}