vboot: Fix FWMP link error if TPM is mocked
authorRandall Spangler <rspangler@chromium.org>
Tue, 10 May 2016 16:45:05 +0000 (09:45 -0700)
committerVadim Bendebury <vbendeb@chromium.org>
Wed, 11 May 2016 02:38:15 +0000 (02:38 +0000)
The MOCK_TPM build flag caused link to fail because RollbackFwmpRead()
was missing its mock.

BUG=chromium:601492
BRANCH=baytrail and newer platforms
TEST=make -j runtests
     Hack makefile to add MOCK_TPM := 1 and make -j; no link errors.

Change-Id: I3885d6b6c627bf475f4da33ef67f31aec2159799
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/343920
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
firmware/lib/mocked_rollback_index.c
firmware/lib/rollback_index.c

index 86f223b..d20ca23 100644 (file)
@@ -82,3 +82,9 @@ uint32_t RollbackBackupWrite(uint8_t *raw)
        Memcpy(rollback_backup, raw, BACKUP_NV_SIZE);
        return TPM_SUCCESS;
 }
+
+uint32_t RollbackFwmpRead(struct RollbackSpaceFwmp *fwmp)
+{
+       Memset(fwmp, 0, sizeof(*fwmp));
+       return TPM_SUCCESS;
+}
index 4436df5..7a4c044 100644 (file)
@@ -552,6 +552,12 @@ uint32_t RollbackKernelLock(int recovery_mode)
        return TPM_SUCCESS;
 }
 
+uint32_t RollbackFwmpRead(struct RollbackSpaceFwmp *fwmp)
+{
+       Memset(fwmp, 0, sizeof(*fwmp));
+       return TPM_SUCCESS;
+}
+
 #else
 
 uint32_t RollbackS3Resume(void)
@@ -678,8 +684,6 @@ uint32_t RollbackKernelLock(int recovery_mode)
        return r;
 }
 
-#endif /* DISABLE_ROLLBACK_TPM */
-
 uint32_t RollbackFwmpRead(struct RollbackSpaceFwmp *fwmp)
 {
        uint8_t buf[FWMP_NV_MAX_SIZE];
@@ -749,3 +753,4 @@ uint32_t RollbackFwmpRead(struct RollbackSpaceFwmp *fwmp)
        return TPM_E_CORRUPTED_STATE;
 }
 
+#endif /* DISABLE_ROLLBACK_TPM */