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

Unified Diff: firmware/lib/rollback_index.c

Issue 2919010: Add tpm lite to vboot reference (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 5 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 | « firmware/include/sysincludes.h ('k') | firmware/lib/tpm_lite/include/tlcl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/rollback_index.c
diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c
index 4a02782bcaf4ed9630760fcb6329601f4c750936..5cbb83787b12b50f8f229d84b50e4af34bc9ca08 100644
--- a/firmware/lib/rollback_index.c
+++ b/firmware/lib/rollback_index.c
@@ -245,8 +245,7 @@ static uint32_t CheckDeveloperModeTransition(uint32_t current_developer) {
* to the TPM flashram at every reboot or wake-up, because of concerns about
* the durability of the NVRAM.
*/
-static uint32_t SetupTPM(int recovery_mode,
- int developer_mode) {
+uint32_t SetupTPM(int recovery_mode, int developer_mode) {
uint8_t disable;
uint8_t deactivated;
uint32_t result;
@@ -290,6 +289,47 @@ static uint32_t SetupTPM(int recovery_mode,
/* disable MSVC warnings on unused arguments */
__pragma(warning (disable: 4100))
+
+#ifdef DISABLE_ROLLBACK_TPM
+
+/* Dummy implementations which don't call into the tpm_lite library */
+
+uint32_t RollbackFirmwareSetup(int developer_mode) {
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackFirmwareRead(uint16_t* key_version, uint16_t* version) {
+ *key_version = *version = 0;
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackFirmwareWrite(uint16_t key_version, uint16_t version) {
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackFirmwareLock(void) {
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackKernelRecovery(int developer_mode) {
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackKernelRead(uint16_t* key_version, uint16_t* version) {
+ *key_version = *version = 0;
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackKernelWrite(uint16_t key_version, uint16_t version) {
+ return TPM_SUCCESS;
+}
+
+uint32_t RollbackKernelLock(void) {
+ return TPM_SUCCESS;
+}
+
+#else
+
uint32_t RollbackFirmwareSetup(int developer_mode) {
return SetupTPM(0, developer_mode);
}
@@ -365,3 +405,5 @@ uint32_t RollbackKernelLock(void) {
return TPM_SUCCESS;
}
}
+
+#endif // DISABLE_ROLLBACK_TPM
« no previous file with comments | « firmware/include/sysincludes.h ('k') | firmware/lib/tpm_lite/include/tlcl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698