| OLD | NEW |
| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 return result; | 75 return result; |
| 76 } | 76 } |
| 77 | 77 |
| 78 /* Creates the NVRAM spaces, and sets their initial values as needed. | 78 /* Creates the NVRAM spaces, and sets their initial values as needed. |
| 79 */ | 79 */ |
| 80 static uint32_t InitializeSpaces(void) { | 80 static uint32_t InitializeSpaces(void) { |
| 81 uint32_t zero = 0; | 81 uint32_t zero = 0; |
| 82 uint32_t firmware_perm = TPM_NV_PER_GLOBALLOCK | TPM_NV_PER_PPWRITE; | 82 uint32_t firmware_perm = TPM_NV_PER_GLOBALLOCK | TPM_NV_PER_PPWRITE; |
| 83 | 83 |
| 84 debug("Initializing spaces\n"); | 84 VBDEBUG(("Initializing spaces\n")); |
| 85 | 85 |
| 86 RETURN_ON_FAILURE(TlclSetNvLocked()); | 86 RETURN_ON_FAILURE(TlclSetNvLocked()); |
| 87 | 87 |
| 88 RETURN_ON_FAILURE(TlclDefineSpace(FIRMWARE_VERSIONS_NV_INDEX, | 88 RETURN_ON_FAILURE(TlclDefineSpace(FIRMWARE_VERSIONS_NV_INDEX, |
| 89 firmware_perm, sizeof(uint32_t))); | 89 firmware_perm, sizeof(uint32_t))); |
| 90 RETURN_ON_FAILURE(SafeWrite(FIRMWARE_VERSIONS_NV_INDEX, | 90 RETURN_ON_FAILURE(SafeWrite(FIRMWARE_VERSIONS_NV_INDEX, |
| 91 (uint8_t*) &zero, sizeof(uint32_t))); | 91 (uint8_t*) &zero, sizeof(uint32_t))); |
| 92 | 92 |
| 93 RETURN_ON_FAILURE(InitializeKernelVersionsSpaces()); | 93 RETURN_ON_FAILURE(InitializeKernelVersionsSpaces()); |
| 94 | 94 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 return TPM_SUCCESS; | 394 return TPM_SUCCESS; |
| 395 } | 395 } |
| 396 | 396 |
| 397 uint32_t RollbackKernelWrite(uint16_t key_version, uint16_t version) { | 397 uint32_t RollbackKernelWrite(uint16_t key_version, uint16_t version) { |
| 398 return TPM_SUCCESS; | 398 return TPM_SUCCESS; |
| 399 } | 399 } |
| 400 | 400 |
| 401 uint32_t RollbackKernelLock(void) { | 401 uint32_t RollbackKernelLock(void) { |
| 402 return TPM_SUCCESS; | 402 return TPM_SUCCESS; |
| 403 } | 403 } |
| OLD | NEW |