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

Unified Diff: tests/rollback_index_mock.c

Issue 3084030: Add structs for TPM NV simplification (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Use new structs Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« firmware/lib/rollback_index.c ('K') | « tests/Makefile ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/rollback_index_mock.c
diff --git a/tests/rollback_index_mock.c b/tests/rollback_index_mock.c
deleted file mode 100644
index 8e96ec1139f7b7b85066f05bad13e02cbfa4d732..0000000000000000000000000000000000000000
--- a/tests/rollback_index_mock.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Mock rollback index library for testing.
- */
-
-#include "rollback_index.h"
-#include "tss_constants.h"
-
-#include <stdio.h>
-
-uint16_t g_firmware_key_version = 0;
-uint16_t g_firmware_version = 0;
-uint16_t g_kernel_key_version = 0;
-uint16_t g_kernel_version = 0;
-
-/* disable MSVC warnings on unused arguments */
-__pragma(warning (disable: 4100))
-
-uint32_t SetupTPM(int mode, int developer_flag) {
-#ifndef NDEBUG
- VBDEBUG(("Rollback Index Library Mock: TPM initialized.\n"));
-#endif
- return TPM_SUCCESS;
-}
-
-uint32_t GetStoredVersions(int type, uint16_t* key_version, uint16_t* version) {
- switch (type) {
- case FIRMWARE_VERSIONS:
- *key_version = g_firmware_key_version;
- *version = g_firmware_version;
- break;
- case KERNEL_VERSIONS:
- *key_version = g_kernel_key_version;
- *version = g_kernel_version;
- break;
- }
- return TPM_SUCCESS;
-}
-
-uint32_t WriteStoredVersions(int type, uint16_t key_version, uint16_t version) {
- switch (type) {
- case FIRMWARE_VERSIONS:
- g_firmware_key_version = key_version;
- g_firmware_version = version;
- break;
- case KERNEL_VERSIONS:
- g_kernel_key_version = key_version;
- g_kernel_version = version;
- break;
- }
-#ifndef NDEBUG
- VBDEBUG(("Rollback Index Library Mock: Stored Versions written.\n"));
-#endif
- return TPM_SUCCESS;
-}
-
-uint32_t LockFirmwareVersions(void) {
-#ifndef NDEBUG
- VBDEBUG(("Rollback Index Library Mock: Firmware Versions Locked.\n"));
-#endif
- return TPM_SUCCESS;
-}
-
-uint32_t LockKernelVersionsByLockingPP(void) {
-#ifndef NDEBUG
- VBDEBUG(("Rollback Index Library Mock: Kernel Versions Locked.\n"));
-#endif
- return TPM_SUCCESS;
-}
« firmware/lib/rollback_index.c ('K') | « tests/Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698