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

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

Issue 3298010: Bail out from S3Resume if TPM was not power-cycled. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: version change Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | firmware/version.c » ('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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 return TPM_SUCCESS; 308 return TPM_SUCCESS;
309 } 309 }
310 310
311 uint32_t RollbackKernelLock(void) { 311 uint32_t RollbackKernelLock(void) {
312 return TPM_SUCCESS; 312 return TPM_SUCCESS;
313 } 313 }
314 314
315 #else 315 #else
316 316
317 uint32_t RollbackS3Resume(void) { 317 uint32_t RollbackS3Resume(void) {
318 uint32_t result;
318 TlclLibInit(); 319 TlclLibInit();
319 RETURN_ON_FAILURE(TlclResume()); 320 /* Check for INVALID_POSTINIT error, so we don't have to worry if this ends
321 * up in hardware that keeps the TPM powered on during S3.
322 */
323 result = TlclResume();
324 if (result == TPM_E_INVALID_POSTINIT) {
325 return TPM_SUCCESS;
326 }
327 if (result != TPM_SUCCESS) {
328 return result;
329 }
320 #ifdef USE_CONTINUE_SELF_TEST 330 #ifdef USE_CONTINUE_SELF_TEST
321 /* TODO: ContinueSelfTest() should be faster than SelfTestFull, but 331 /* TODO: ContinueSelfTest() should be faster than SelfTestFull, but
322 * may also not work properly in older TPM firmware. For now, do 332 * may also not work properly in older TPM firmware. For now, do
323 * the full self test. */ 333 * the full self test. */
324 RETURN_ON_FAILURE(TlclContinueSelfTest()); 334 RETURN_ON_FAILURE(TlclContinueSelfTest());
325 #else 335 #else
326 RETURN_ON_FAILURE(TlclSelfTestFull()); 336 RETURN_ON_FAILURE(TlclSelfTestFull());
327 #endif 337 #endif
328 return TPM_SUCCESS; 338 return TPM_SUCCESS;
329 } 339 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 426
417 uint32_t RollbackKernelLock(void) { 427 uint32_t RollbackKernelLock(void) {
418 if (g_rollback_recovery_mode) { 428 if (g_rollback_recovery_mode) {
419 return TPM_SUCCESS; 429 return TPM_SUCCESS;
420 } else { 430 } else {
421 return TlclLockPhysicalPresence(); 431 return TlclLockPhysicalPresence();
422 } 432 }
423 } 433 }
424 434
425 #endif // DISABLE_ROLLBACK_TPM 435 #endif // DISABLE_ROLLBACK_TPM
OLDNEW
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698