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

Side by Side Diff: firmware/lib/rollback_index.c

Issue 5796005: vboot TPM stub functions return error codes (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Respond to code reviews Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « firmware/include/tss_constants.h ('k') | firmware/lib/tpm_lite/include/tlcl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 uint8_t disable; 190 uint8_t disable;
191 uint8_t deactivated; 191 uint8_t deactivated;
192 uint32_t result; 192 uint32_t result;
193 193
194 VBDEBUG(("TPM: SetupTPM(r%d, d%d)\n", recovery_mode, developer_mode)); 194 VBDEBUG(("TPM: SetupTPM(r%d, d%d)\n", recovery_mode, developer_mode));
195 195
196 if (recovery_mode) 196 if (recovery_mode)
197 g_rollback_recovery_mode = 1; /* Global variables are usable in 197 g_rollback_recovery_mode = 1; /* Global variables are usable in
198 * recovery mode */ 198 * recovery mode */
199 199
200 /* TODO: TlclLibInit() should be able to return failure */ 200 RETURN_ON_FAILURE(TlclLibInit());
201 TlclLibInit();
202 201
203 RETURN_ON_FAILURE(TlclStartup()); 202 RETURN_ON_FAILURE(TlclStartup());
204 /* Use ContinueSelfTest rather than SelfTestFull(). It enables 203 /* Use ContinueSelfTest rather than SelfTestFull(). It enables
205 * access to the subset of TPM commands we need in the firmware, and 204 * access to the subset of TPM commands we need in the firmware, and
206 * allows the full self test to run in paralle with firmware 205 * allows the full self test to run in paralle with firmware
207 * startup. By the time we get to the OS, self test will have 206 * startup. By the time we get to the OS, self test will have
208 * completed. */ 207 * completed. */
209 RETURN_ON_FAILURE(TlclContinueSelfTest()); 208 RETURN_ON_FAILURE(TlclContinueSelfTest());
210 result = TlclAssertPhysicalPresence(); 209 result = TlclAssertPhysicalPresence();
211 if (result != 0) { 210 if (result != 0) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 328 }
330 329
331 uint32_t RollbackKernelLock(void) { 330 uint32_t RollbackKernelLock(void) {
332 return TPM_SUCCESS; 331 return TPM_SUCCESS;
333 } 332 }
334 333
335 #else 334 #else
336 335
337 uint32_t RollbackS3Resume(void) { 336 uint32_t RollbackS3Resume(void) {
338 uint32_t result; 337 uint32_t result;
339 TlclLibInit(); 338 RETURN_ON_FAILURE(TlclLibInit());
340 result = TlclResume(); 339 result = TlclResume();
341 if (result == TPM_E_INVALID_POSTINIT) { 340 if (result == TPM_E_INVALID_POSTINIT) {
342 /* We're on a platform where the TPM maintains power in S3, so 341 /* We're on a platform where the TPM maintains power in S3, so
343 it's already initialized. */ 342 it's already initialized. */
344 return TPM_SUCCESS; 343 return TPM_SUCCESS;
345 } 344 }
346 return result; 345 return result;
347 } 346 }
348 347
349 348
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 438
440 uint32_t RollbackKernelLock(void) { 439 uint32_t RollbackKernelLock(void) {
441 if (g_rollback_recovery_mode) { 440 if (g_rollback_recovery_mode) {
442 return TPM_SUCCESS; 441 return TPM_SUCCESS;
443 } else { 442 } else {
444 return TlclLockPhysicalPresence(); 443 return TlclLockPhysicalPresence();
445 } 444 }
446 } 445 }
447 446
448 #endif // DISABLE_ROLLBACK_TPM 447 #endif // DISABLE_ROLLBACK_TPM
OLDNEW
« no previous file with comments | « firmware/include/tss_constants.h ('k') | firmware/lib/tpm_lite/include/tlcl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698