summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-05-26 18:12:29 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-05-31 00:24:00 -0700
commitbff0a8093402790f3f58af80eb09509c27cafdaf (patch)
tree7d818f69c4dc1e81986c590757c58f416b5439b7 /common
parenta25bcc8e944d467583c4ff3e7380c095fd3e93e0 (diff)
downloadchrome-ec-bff0a8093402790f3f58af80eb09509c27cafdaf.tar.gz
usb_update: Add support for INJECT_ENTROPY command (fixups)
Minor fixups on CL:513807. BRANCH=none BUG=b:38487027 TEST=none Change-Id: I8c17a21a13b6befc7ef305789930a321ac725204 Reviewed-on: https://chromium-review.googlesource.com/516868 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_update.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/usb_update.c b/common/usb_update.c
index 153411b5e0..8ec5a5fd89 100644
--- a/common/usb_update.c
+++ b/common/usb_update.c
@@ -210,7 +210,7 @@ static int try_vendor_command(struct consumer const *consumer, size_t count)
* 2 bytes subcommand + secret length).
*/
int header_size = sizeof(*cmd_buffer) + 2;
- int entropy_count = count-header_size;
+ int entropy_count = count - header_size;
if (entropy_count < CONFIG_ROLLBACK_SECRET_SIZE) {
CPRINTS("Entropy too short");
@@ -219,8 +219,9 @@ static int try_vendor_command(struct consumer const *consumer, size_t count)
}
CPRINTS("Adding %db of entropy", entropy_count);
- /* Add the whole buffer to entropy. */
- rollback_add_entropy(buffer+header_size, entropy_count);
+ /* Add the entropy to secret. */
+ rollback_add_entropy(buffer + header_size,
+ entropy_count);
break;
}
#endif