summaryrefslogtreecommitdiff
path: root/futility/futility.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-01-15 18:07:23 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-16 05:26:12 -0800
commit859682accb19893803026a28b4c8ca2cd57945a4 (patch)
tree5c267f75c9d5ad245894fb700c32ff7cb058e563 /futility/futility.h
parent575e14b1623572236204d606664a20d22bca8e94 (diff)
downloadvboot-859682accb19893803026a28b4c8ca2cd57945a4.tar.gz
futility: updater: Correct HWID digest when preserving HWIDstabilize-11647.70.Bstabilize-11647.104.Brelease-R73-11647.B
Starting from GBB 1.2, a digest is stored in GBB and must be updated whenever the HWID string is changed. In shell script version of updater, the digest is automatically updated when we do "futility gbb -s --hwid=XXX", but in native updater implementation we only updated the HWID string and left digest unchanged, this leaves devices generating wrong PCR1 values. `cmd_gbb_utility` updates the digest by calling `update_hwid_digest` using vboot1 structure, so we should introduce a new vboot2 friendly function, `vb2_change_hwid`, which changes both HWID string and digest at same time. Note this has no impact for end user's devices with write protection enabled. Only changes dogfood units AU results. BUG=b:122248649 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=none Change-Id: I6ad2754e6df3c9dd66d71c560a2afc26d14eae33 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1411932 Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'futility/futility.h')
-rw-r--r--futility/futility.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/futility/futility.h b/futility/futility.h
index f0635750..f5f6877e 100644
--- a/futility/futility.h
+++ b/futility/futility.h
@@ -108,6 +108,9 @@ int futil_looks_like_gbb(GoogleBinaryBlockHeader *gbb, uint32_t len);
int futil_valid_gbb_header(GoogleBinaryBlockHeader *gbb, uint32_t len,
uint32_t *maxlen);
+/* Sets the HWID string field inside a GBB header. */
+int futil_set_gbb_hwid(struct vb2_gbb_header *gbb, const char *hwid);
+
/* For GBB v1.2 and later, update the hwid_digest */
void update_hwid_digest(GoogleBinaryBlockHeader *gbb);