[SeaBIOS] [PATCH] Ignore certain error when asserting physical presence
Stefan Berger
stefanb at linux.vnet.ibm.com
Tue May 26 21:16:48 CEST 2015
Some hardware TPMs do not support the assertion of physical presence
via the command. Ignore the specific error code TPM_BAD_PARAMETER if
we come across such a device.
Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
---
src/tcgbios.c | 3 ++-
src/tcgbios.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tcgbios.c b/src/tcgbios.c
index 4cda800..04904e3 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -517,7 +517,8 @@ tpm_leave_bios(void)
PhysicalPresence_CMD_ENABLE,
sizeof(PhysicalPresence_CMD_ENABLE),
NULL, 10, &returnCode, TPM_DURATION_TYPE_SHORT);
- if (rc || returnCode)
+ /* some TPMs do not support phys. presence enablement */
+ if (rc || (returnCode && returnCode != TPM_BAD_PARAMETER))
goto err_exit;
rc = build_and_send_cmd(0, TPM_ORD_PhysicalPresence,
diff --git a/src/tcgbios.h b/src/tcgbios.h
index 332d785..72fd771 100644
--- a/src/tcgbios.h
+++ b/src/tcgbios.h
@@ -88,6 +88,7 @@
/* TPM command error codes */
+#define TPM_BAD_PARAMETER 0x3
#define TPM_INVALID_POSTINIT 0x26
#define TPM_BAD_LOCALITY 0x3d
--
1.9.3
More information about the SeaBIOS
mailing list