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 * Functions for querying, manipulating and locking rollback indices |
| 6 * stored in the TPM NVRAM. |
| 7 */ |
| 8 |
| 9 #ifndef VBOOT_REFERENCE_ROLLBACK_INDEX_H_ |
| 10 #define VBOOT_REFERENCE_ROLLBACK_INDEX_H_ |
| 11 |
| 12 #include <stdint.h> |
| 13 |
| 14 extern uint16_t g_firmware_key_version; |
| 15 extern uint16_t g_firmware_version; |
| 16 extern uint16_t g_kernel_key_version; |
| 17 extern uint16_t g_kernel_version; |
| 18 |
| 19 /* Rollback version types. */ |
| 20 #define FIRMWARE_KEY_VERSION 0 |
| 21 #define FIRMWARE_VERSION 1 |
| 22 #define KERNEL_KEY_VERSION 2 |
| 23 #define KERNEL_VERSION 3 |
| 24 |
| 25 /* TPM NVRAM location indices. */ |
| 26 #define FIRMWARE_KEY_VERSION_NV_INDEX 0x1001 |
| 27 #define FIRMWARE_VERSION_NV_INDEX 0x1002 |
| 28 #define KERNEL_KEY_VERSION_NV_INDEX 0x1003 |
| 29 #define KERNEL_VERSION_NV_INDEX 0x1004 |
| 30 |
| 31 void SetupTPM(void); |
| 32 uint16_t GetStoredVersion(int type); |
| 33 int WriteStoredVersion(int type, uint16_t version); |
| 34 void LockStoredVersion(int type); |
| 35 |
| 36 #endif /* VBOOT_REFERENCE_ROLLBACK_INDEX_H_ */ |
OLD | NEW |