summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2022-11-30 11:48:16 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-01 04:11:09 +0000
commit0f42a18674ab8ffcc8f2022feceabc47e0dc4f10 (patch)
tree3794c52a1ee6d6e87dd52938c0ef68194f1452f0 /board
parent35adc7e3efd58ac1b96a0da22221c6461f61f392 (diff)
downloadchrome-ec-0f42a18674ab8ffcc8f2022feceabc47e0dc4f10.tar.gz
apro: check usb_spi_sha256_update return code
If usb_spi_sha256_update returns something other than EC_SUCCESS, fail verification. BUG=b:260878795 TEST=add a delay to make spi_hash timeout. Verify cr50 fails verification. Change-Id: I4ba750748eb131046828f642b9736ed62a781789 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4066233 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/cr50/usb_spi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/cr50/usb_spi.c b/board/cr50/usb_spi.c
index a16c2df3e5..68533ed286 100644
--- a/board/cr50/usb_spi.c
+++ b/board/cr50/usb_spi.c
@@ -709,6 +709,10 @@ int usb_spi_sha256_update(struct sha256_ctx *ctx, uint32_t offset,
{
uint8_t data[SPI_HASH_CHUNK_SIZE];
+ if (get_spi_bus_user() != SPI_BUS_USER_HASH) {
+ CPRINTS("%s: disabled", __func__);
+ return VENDOR_RC_NOT_ALLOWED;
+ }
if (print_range) {
CPRINTS("%s: %x:%x", __func__, offset, size);
/* Make sure the message gets out before verification starts. */