summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>2017-09-26 12:18:00 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-09-27 19:03:03 -0700
commit49958cf5c229c2719304eef1fc8c0c40e8620ac4 (patch)
treeff2aaf4baa30401c12083e114c33cea185de1189
parent8a451f50ef0576553aa7ce17ff625efde6d396ec (diff)
downloadchrome-ec-49958cf5c229c2719304eef1fc8c0c40e8620ac4.tar.gz
vboot: Modify the parameter offset
For the Host Command vboot hash EC_VBOOT_HASH_GET case, if the input parameter offset and size is 0 then change offset to data_offset to obtain the latest hash value. Else retain the offset to get the hash value at offset. BUG=b:66957716 BRANCH=NONE TEST=On Soraka, ectool echash commands (RO, RW) should result in hash information. Change-Id: Ife17d35b0dfeecb5ec799c9ed722ae48dbec5b5b Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com> Reviewed-on: https://chromium-review.googlesource.com/685738 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--common/vboot_hash.c6
-rw-r--r--util/ectool.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/common/vboot_hash.c b/common/vboot_hash.c
index 21a78aa585..5a3957274f 100644
--- a/common/vboot_hash.c
+++ b/common/vboot_hash.c
@@ -437,7 +437,11 @@ static int host_command_vboot_hash(struct host_cmd_handler_args *args)
switch (p->cmd) {
case EC_VBOOT_HASH_GET:
- fill_response(r, p->offset);
+ if (p->offset || p->size)
+ fill_response(r, p->offset);
+ else
+ fill_response(r, data_offset);
+
args->response_size = sizeof(*r);
return EC_RES_SUCCESS;
diff --git a/util/ectool.c b/util/ectool.c
index 89b3b6e028..0fecb6db83 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -6193,6 +6193,7 @@ int cmd_ec_hash(int argc, char *argv[])
char *e;
int rv;
+ memset(&p, 0, sizeof(p));
if (argc < 2) {
/* Get hash status */
p.cmd = EC_VBOOT_HASH_GET;