summaryrefslogtreecommitdiff
path: root/futility
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-03-11 14:42:51 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-12 03:33:00 -0700
commit2798b3bf39a3204385887c705ccfebc78fd07e48 (patch)
tree469245e6a4064df11358e83e605d3d48e82cb3e0 /futility
parent3f02fc10e59fbbe77f831a047793849a205a5889 (diff)
downloadvboot-2798b3bf39a3204385887c705ccfebc78fd07e48.tar.gz
futility: updater: Report key hash on TPM failure
When write protection is not enabled and updater sees TPM Anti-Rollback failure, the log will only report TPM failure (example: crbug.com/937961). This is hard to figure out if the failure was caused by re-key or other reasons. In try-rw and rw update, the updater will always check rootkey compatibility before checking TPM anti-rollback, so we should do the same thing on full update (RO+RW). With this change, the updater will report key mismatch before failing with TPM anti-rollback. BUG=chromium:937961 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I2f035450995387b198f990467e4f416e6c7b746e Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1514007 Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r--futility/updater.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/futility/updater.c b/futility/updater.c
index a4e8a996..c737f16f 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -1615,8 +1615,6 @@ static enum updater_error_codes update_whole_firmware(
DEBUG("Failed to preserve some sections - ignore.");
INFO("Checking compatibility...");
- if (check_compatible_tpm_keys(cfg, image_to))
- return UPDATE_ERR_TPM_ROLLBACK;
if (!cfg->force_update) {
/* Check if the image_to itself is broken */
enum rootkey_compat_result r = check_compatible_root_key(
@@ -1644,6 +1642,8 @@ static enum updater_error_codes update_whole_firmware(
return UPDATE_ERR_ROOT_KEY;
}
}
+ if (check_compatible_tpm_keys(cfg, image_to))
+ return UPDATE_ERR_TPM_ROLLBACK;
/* FMAP may be different so we should just update all. */
if (write_firmware(cfg, image_to, NULL) ||