summaryrefslogtreecommitdiff
path: root/futility/futility.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-10-02 18:50:33 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-21 22:44:12 +0000
commit6df3e33912baf2633ed27fce6fe166d87e2f04a8 (patch)
tree97ae4ca1d602d15715a77888f332b708e9a4abf1 /futility/futility.h
parent8bb3689d42089241b209ccea2860f03aeaddd8f8 (diff)
downloadvboot-6df3e33912baf2633ed27fce6fe166d87e2f04a8.tar.gz
Add hwid digest field to GBB header
This adds a field in the GBB header to store the sha256 digest of the HWID string, and updates gbb_utility so that it stores the digest when it modifies the HWID. Because this is a new field, the GBB_MINOR_VER is incremented. BUG=chromium:415227 BRANCH=ToT TEST=make runtests, VBOOT2=1 make runtests Since the GBB is in the RO firmware, there should be no side effects for existing devices (but even without that, they should handle a minor version change without complaint). Change-Id: Icdb2a0b564677b0b65e58df897d2ec5af3964998 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/221360
Diffstat (limited to 'futility/futility.h')
-rw-r--r--futility/futility.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/futility/futility.h b/futility/futility.h
index 7892c5ad..52c007cc 100644
--- a/futility/futility.h
+++ b/futility/futility.h
@@ -71,6 +71,14 @@ int futil_looks_like_gbb(GoogleBinaryBlockHeader *gbb, uint32_t len);
int futil_valid_gbb_header(GoogleBinaryBlockHeader *gbb, uint32_t len,
uint32_t *maxlen);
+/* For GBB v1.2 and later, update the hwid_digest */
+void update_hwid_digest(GoogleBinaryBlockHeader *gbb);
+
+/* For GBB v1.2 and later, print the stored digest of the HWID (and whether
+ * it's correct). Return true if it is correct. */
+int print_hwid_digest(GoogleBinaryBlockHeader *gbb,
+ const char *banner, const char *footer);
+
/* Copies a file or dies with an error message */
void futil_copy_file_or_die(const char *infile, const char *outfile);