Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: utility/tpm_init_temp_fix.c

Issue 3131007: Run self test unconditionally. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utility/tpm_init_temp_fix.c
diff --git a/utility/tpm_init_temp_fix.c b/utility/tpm_init_temp_fix.c
index b641813321b4c5a7d949e1aaf0e6270a08745ce9..d3004a6226f61453ea4f65ef244e43b695012867 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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698