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

Side by Side Diff: tests/rollback_index_mock.c

Issue 2792009: Fix normal/recovery mode, and RO firmware vs. RW firmware behavior. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: add a comment Created 10 years, 6 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
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 * 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
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 }
OLDNEW
« no previous file with comments | « no previous file | vboot_firmware/include/rollback_index.h » ('j') | vboot_firmware/include/rollback_index.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698