summaryrefslogtreecommitdiff
path: root/common/usb_update.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-08-30 15:02:48 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-09-15 10:50:27 -0700
commit82e0892fc39a107285474b6f3ae3d1eb3901d82c (patch)
tree4518487f58bc27ace356e610db55266610eb9a3e /common/usb_update.c
parent4fdccb6de5131475fb6ccd3402812e008091afa3 (diff)
downloadchrome-ec-82e0892fc39a107285474b6f3ae3d1eb3901d82c.tar.gz
update_fw: Store complete touchpad FW hash
This will be used by the updater to first check that the touchpad FW on AP side matches the one for which we stored hashes on EC side. This guarantee that we do not accidentally try to flash an incorrect FW, which would render the touchpad non-functional. BRANCH=none BUG=b:63993173 TEST=make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \ BOARD=hammer -j TEST=./usb_updater2 -t includes output of sha256sum A459C-1211_ForGoogleHammer_3.0.bin Change-Id: Id30ab2d7c7d7e2d0f25cc893f685d218c44c022e Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/641736 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/usb_update.c')
-rw-r--r--common/usb_update.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/usb_update.c b/common/usb_update.c
index cfbcca9246..c73459126c 100644
--- a/common/usb_update.c
+++ b/common/usb_update.c
@@ -316,8 +316,12 @@ static int try_vendor_command(struct consumer const *consumer, size_t count)
#ifdef CONFIG_TOUCHPAD_VIRTUAL_OFF
tp.fw_address = CONFIG_TOUCHPAD_VIRTUAL_OFF;
tp.fw_size = CONFIG_TOUCHPAD_VIRTUAL_SIZE;
-#endif
+#ifdef CONFIG_TOUCHPAD_HASH_FW
+ memcpy(tp.allowed_fw_hash, touchpad_fw_full_hash,
+ sizeof(tp.allowed_fw_hash));
+#endif
+#endif /* CONFIG_TOUCHPAD_VIRTUAL_OFF */
QUEUE_ADD_UNITS(&update_to_usb,
&tp, response_size);
return 1;