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

Unified Diff: src/platform/vboot_reference/include/rollback_index.h

Issue 1241002: VBoot Reference: Add version checking to for preventing rollbacks. (Closed)
Patch Set: . Created 10 years, 9 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
Index: src/platform/vboot_reference/include/rollback_index.h
diff --git a/src/platform/vboot_reference/include/rollback_index.h b/src/platform/vboot_reference/include/rollback_index.h
new file mode 100644
index 0000000000000000000000000000000000000000..d4e47ac893c267c5c27552575f4d3ea6d0fd98fa
--- /dev/null
+++ b/src/platform/vboot_reference/include/rollback_index.h
@@ -0,0 +1,36 @@
+/* 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.
+ *
+ * Functions for querying, manipulating and locking rollback indices
+ * stored in the TPM NVRAM.
+ */
+
+#ifndef VBOOT_REFERENCE_ROLLBACK_INDEX_H_
+#define VBOOT_REFERENCE_ROLLBACK_INDEX_H_
+
+#include <stdint.h>
+
+extern uint16_t g_firmware_key_version;
+extern uint16_t g_firmware_version;
+extern uint16_t g_kernel_key_version;
+extern uint16_t g_kernel_version;
+
+/* Rollback version types. */
+#define FIRMWARE_KEY_VERSION 0
+#define FIRMWARE_VERSION 1
+#define KERNEL_KEY_VERSION 2
+#define KERNEL_VERSION 3
+
+/* TPM NVRAM location indices. */
+#define FIRMWARE_KEY_VERSION_NV_INDEX 0x1001
+#define FIRMWARE_VERSION_NV_INDEX 0x1002
+#define KERNEL_KEY_VERSION_NV_INDEX 0x1003
+#define KERNEL_VERSION_NV_INDEX 0x1004
+
+void SetupTPM(void);
+uint16_t GetStoredVersion(int type);
+int WriteStoredVersion(int type, uint16_t version);
+void LockStoredVersion(int type);
+
+#endif /* VBOOT_REFERENCE_ROLLBACK_INDEX_H_ */
« no previous file with comments | « src/platform/vboot_reference/include/firmware_image.h ('k') | src/platform/vboot_reference/include/utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698