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

Unified Diff: src/platform/vboot_reference/tests/rollback_index_mock.c

Issue 2344002: Add recovery mode protection to new NVRAM locking scheme. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: typo in comment Created 10 years, 7 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
« no previous file with comments | « no previous file | src/platform/vboot_reference/vboot_firmware/include/rollback_index.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/tests/rollback_index_mock.c
diff --git a/src/platform/vboot_reference/tests/rollback_index_mock.c b/src/platform/vboot_reference/tests/rollback_index_mock.c
index c7c6d6ff1cec84023e0d1e87199277be6de13156..9640e316b11d1f340607016c73cc7512b802d04f 100644
--- a/src/platform/vboot_reference/tests/rollback_index_mock.c
+++ b/src/platform/vboot_reference/tests/rollback_index_mock.c
@@ -21,41 +21,32 @@ void SetupTPM(void) {
#endif
}
-uint16_t GetStoredVersion(int type) {
+void GetStoredVersions(int type, uint16_t* key_version, uint16_t* version) {
switch (type) {
- case FIRMWARE_KEY_VERSION:
- return g_firmware_key_version;
+ case FIRMWARE_VERSIONS:
+ *key_version = g_firmware_key_version;
+ *version = g_firmware_version;
break;
- case FIRMWARE_VERSION:
- return g_firmware_version;
- break;
- case KERNEL_KEY_VERSION:
- return g_kernel_key_version;
- break;
- case KERNEL_VERSION:
- return g_kernel_version;
+ case KERNEL_VERSIONS:
+ *key_version = g_kernel_key_version;
+ *version = g_kernel_version;
break;
}
- return 0;
}
-int WriteStoredVersion(int type, uint16_t version) {
+int WriteStoredVersions(int type, uint16_t key_version, uint16_t version) {
switch (type) {
- case FIRMWARE_KEY_VERSION:
- g_firmware_key_version = version;
- break;
- case FIRMWARE_VERSION:
+ case FIRMWARE_VERSIONS:
+ g_firmware_key_version = key_version;
g_firmware_version = version;
break;
- case KERNEL_KEY_VERSION:
- g_kernel_key_version = version;
- break;
- case KERNEL_VERSION:
+ case KERNEL_VERSIONS:
+ g_kernel_key_version = key_version;
g_kernel_version = version;
break;
}
#ifndef NDEBUG
- debug("Rollback Index Library Mock: Stored Version written.\n");
+ debug("Rollback Index Library Mock: Stored Versions written.\n");
#endif
return 1;
}
« no previous file with comments | « no previous file | src/platform/vboot_reference/vboot_firmware/include/rollback_index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698