| OLD | NEW |
| 1 /* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 * | 4 * |
| 5 * Functions for querying, manipulating and locking rollback indices | 5 * Functions for querying, manipulating and locking rollback indices |
| 6 * stored in the TPM NVRAM. | 6 * stored in the TPM NVRAM. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "rollback_index.h" | 9 #include "rollback_index.h" |
| 10 | 10 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 return WriteSpaceFirmware(&rsf); | 347 return WriteSpaceFirmware(&rsf); |
| 348 } | 348 } |
| 349 | 349 |
| 350 uint32_t RollbackFirmwareLock(void) { | 350 uint32_t RollbackFirmwareLock(void) { |
| 351 return TlclSetGlobalLock(); | 351 return TlclSetGlobalLock(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 uint32_t RollbackKernelRecovery(int developer_mode) { | 354 uint32_t RollbackKernelRecovery(int developer_mode) { |
| 355 uint32_t rvs, rve; | 355 uint32_t rvs, rve; |
| 356 RollbackSpaceFirmware rsf; | 356 RollbackSpaceFirmware rsf; |
| 357 uint8_t out_digest[20]; /* For PCR extend output */ | |
| 358 | 357 |
| 359 /* In recovery mode we ignore TPM malfunctions or corruptions, and * | 358 /* In recovery mode we ignore TPM malfunctions or corruptions, and * |
| 360 * leave the TPM complelely unlocked; we call neither | 359 * leave the TPM complelely unlocked; we call neither |
| 361 * TlclSetGlobalLock() nor TlclLockPhysicalPresence(). The recovery | 360 * TlclSetGlobalLock() nor TlclLockPhysicalPresence(). The recovery |
| 362 * kernel will fix the TPM (if needed) and lock it ASAP. We leave | 361 * kernel will fix the TPM (if needed) and lock it ASAP. We leave |
| 363 * Physical Presence on in either case. */ | 362 * Physical Presence on in either case. */ |
| 364 rvs = SetupTPM(1, developer_mode, &rsf); | 363 rvs = SetupTPM(1, developer_mode, &rsf); |
| 365 rve = SetTPMBootModeState(developer_mode, | 364 rve = SetTPMBootModeState(developer_mode, |
| 366 1, /* Recovery Mode Status. */ | 365 1, /* Recovery Mode Status. */ |
| 367 0); /* In recovery mode, there is no RW firmware | 366 0); /* In recovery mode, there is no RW firmware |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 407 |
| 409 uint32_t RollbackKernelLock(void) { | 408 uint32_t RollbackKernelLock(void) { |
| 410 if (g_rollback_recovery_mode) { | 409 if (g_rollback_recovery_mode) { |
| 411 return TPM_SUCCESS; | 410 return TPM_SUCCESS; |
| 412 } else { | 411 } else { |
| 413 return TlclLockPhysicalPresence(); | 412 return TlclLockPhysicalPresence(); |
| 414 } | 413 } |
| 415 } | 414 } |
| 416 | 415 |
| 417 #endif // DISABLE_ROLLBACK_TPM | 416 #endif // DISABLE_ROLLBACK_TPM |
| OLD | NEW |