summaryrefslogtreecommitdiff
path: root/utility/tpm_init_temp_fix.c
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@google.com>2010-08-12 09:26:50 -0700
committerLuigi Semenzato <semenzato@google.com>2010-08-12 09:26:50 -0700
commitd7bff87a745dd378aebec5bc6e78039426044b3a (patch)
tree6340a12a5233b858905f5c24b61ff8814621d053 /utility/tpm_init_temp_fix.c
parent83ba6d36b8a238a4870ee6e1ee7fd7b24d8ab224 (diff)
downloadvboot-d7bff87a745dd378aebec5bc6e78039426044b3a.tar.gz
Run self test unconditionally.
Review URL: http://codereview.chromium.org/3131007
Diffstat (limited to 'utility/tpm_init_temp_fix.c')
-rw-r--r--utility/tpm_init_temp_fix.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/utility/tpm_init_temp_fix.c b/utility/tpm_init_temp_fix.c
index b6418133..d3004a62 100644
--- a/utility/tpm_init_temp_fix.c
+++ b/utility/tpm_init_temp_fix.c
@@ -29,15 +29,21 @@ int main(int argc, char* argv[]) {
TlclLibInit();
TlclStartup(); /* ignore result */
+
+ /* On the dogfood device, GetFlags causes an assertion failure because the
+ * device uses an older TPM which is not compatible with the current spec.
+ * We take advantage of this to cause the program to exit and not run the
+ * self test again (which takes 1 second).
+ */
result = TlclGetFlags(NULL, NULL, NULL);
+
+ result = TlclSelfTestFull();
if (result != 0) {
- result = TlclSelfTestFull();
- if (result != 0) {
- syslog(pri, "TPM selftest failed with code 0x%x\n", result);
- printf("fail\n");
- return 0;
- }
+ syslog(pri, "TPM selftest failed with code 0x%x\n", result);
+ printf("fail\n");
+ return 0;
}
+
/* Optional one-time enabling of TPM. */
result = TlclAssertPhysicalPresence();
if (result != 0) {