OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* Shared code for tests. |
| 7 */ |
| 8 |
| 9 #include "tlcl.h" |
| 10 #include "tlcl_tests.h" |
| 11 |
| 12 const char* resilient_startup = NULL; |
| 13 |
| 14 uint32_t TlclStartupIfNeeded(void) { |
| 15 static char* null_getenv = "some string"; /* just a unique address */ |
| 16 uint32_t result = TlclStartup(); |
| 17 if (resilient_startup == NULL) { |
| 18 resilient_startup = getenv("TLCL_RESILIENT_STARTUP"); |
| 19 if (resilient_startup == NULL) { |
| 20 resilient_startup = null_getenv; |
| 21 } |
| 22 } |
| 23 if (resilient_startup == null_getenv) { |
| 24 return result; |
| 25 } |
| 26 return result == TPM_E_INVALID_POSTINIT ? TPM_SUCCESS : result; |
| 27 } |
OLD | NEW |