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 * Mock rollback index library for testing. | 5 * Mock rollback index library for testing. |
6 */ | 6 */ |
7 | 7 |
8 #include "rollback_index.h" | 8 #include "rollback_index.h" |
9 #include "tss_constants.h" | 9 #include "tss_constants.h" |
10 | 10 |
11 #include <stdint.h> | 11 #include <stdint.h> |
12 #include <stdio.h> | 12 #include <stdio.h> |
13 | 13 |
14 uint16_t g_firmware_key_version = 0; | 14 uint16_t g_firmware_key_version = 0; |
15 uint16_t g_firmware_version = 0; | 15 uint16_t g_firmware_version = 0; |
16 uint16_t g_kernel_key_version = 0; | 16 uint16_t g_kernel_key_version = 0; |
17 uint16_t g_kernel_version = 0; | 17 uint16_t g_kernel_version = 0; |
18 | 18 |
19 uint32_t SetupTPM(void) { | 19 uint32_t SetupTPM(int mode, int developer_flag) { |
20 #ifndef NDEBUG | 20 #ifndef NDEBUG |
21 debug("Rollback Index Library Mock: TPM initialized.\n"); | 21 debug("Rollback Index Library Mock: TPM initialized.\n"); |
22 #endif | 22 #endif |
23 return TPM_SUCCESS; | 23 return TPM_SUCCESS; |
24 } | 24 } |
25 | 25 |
26 uint32_t GetStoredVersions(int type, uint16_t* key_version, uint16_t* version) { | 26 uint32_t GetStoredVersions(int type, uint16_t* key_version, uint16_t* version) { |
27 switch (type) { | 27 switch (type) { |
28 case FIRMWARE_VERSIONS: | 28 case FIRMWARE_VERSIONS: |
29 *key_version = g_firmware_key_version; | 29 *key_version = g_firmware_key_version; |
(...skipping 30 matching lines...) Expand all Loading... |
60 #endif | 60 #endif |
61 return TPM_SUCCESS; | 61 return TPM_SUCCESS; |
62 } | 62 } |
63 | 63 |
64 uint32_t LockKernelVersionsByLockingPP(void) { | 64 uint32_t LockKernelVersionsByLockingPP(void) { |
65 #ifndef NDEBUG | 65 #ifndef NDEBUG |
66 debug("Rollback Index Library Mock: Kernel Versions Locked.\n"); | 66 debug("Rollback Index Library Mock: Kernel Versions Locked.\n"); |
67 #endif | 67 #endif |
68 return TPM_SUCCESS; | 68 return TPM_SUCCESS; |
69 } | 69 } |
OLD | NEW |