diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2018-01-10 19:00:49 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-12-05 00:50:15 +0000 |
commit | 631e8aba1beb3cee4330c6c2ac014b2f00c1be55 (patch) | |
tree | 17266e66097631a7439cb497d354678efb608c8a | |
parent | 38f6693479e10096c9a075271fc2aca5db9dec0d (diff) | |
download | chrome-ec-631e8aba1beb3cee4330c6c2ac014b2f00c1be55.tar.gz |
ccd: add distinct return code to indicate that password is required
When user is trying to execute 'ccd open' or 'ccd unlock' and password
is set, the return error code does not allow to tell the reason for
the command failure.
Let's add a distinct return code to indicate this condition so that
the user can supply password.
BRANCH=cr50
BUG=b:62537474
TEST=verified along with the accompanying gsctool modifications.
Change-Id: I286f87ab12114cd7dd7ebcdf0e321f7a24723367
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/861208
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1333225
Reviewed-by: Marco Chen <marcochen@chromium.org>
Commit-Queue: Marco Chen <marcochen@chromium.org>
Tested-by: Marco Chen <marcochen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1359947
Reviewed-by: Chia-Hsiu Chang <chia-hsiu.chang@quanta.corp-partner.google.com>
Tested-by: Chia-Hsiu Chang <chia-hsiu.chang@quanta.corp-partner.google.com>
Commit-Queue: Chia-Hsiu Chang <chia-hsiu.chang@quanta.corp-partner.google.com>
-rw-r--r-- | common/ccd_config.c | 4 | ||||
-rw-r--r-- | include/tpm_vendor_cmds.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/common/ccd_config.c b/common/ccd_config.c index 33978f864f..8d38f0c541 100644 --- a/common/ccd_config.c +++ b/common/ccd_config.c @@ -846,7 +846,7 @@ static enum vendor_cmd_rc ccd_open(void *buf, if (!input_size) { *response_size = 1; buffer[0] = EC_ERROR_PARAM_COUNT; - return VENDOR_RC_INTERNAL_ERROR; + return VENDOR_RC_PASSWORD_REQUIRED; } /* @@ -931,7 +931,7 @@ static enum vendor_cmd_rc ccd_unlock(void *buf, if (!input_size) { *response_size = 1; buffer[0] = EC_ERROR_PARAM_COUNT; - return VENDOR_RC_INTERNAL_ERROR; + return VENDOR_RC_PASSWORD_REQUIRED; } /* diff --git a/include/tpm_vendor_cmds.h b/include/tpm_vendor_cmds.h index c815998c21..1cdfb7599c 100644 --- a/include/tpm_vendor_cmds.h +++ b/include/tpm_vendor_cmds.h @@ -78,6 +78,7 @@ enum vendor_cmd_rc { VENDOR_RC_NOT_ALLOWED = 7, VENDOR_RC_NO_SUCH_SUBCOMMAND = 8, VENDOR_RC_IN_PROGRESS = 9, + VENDOR_RC_PASSWORD_REQUIRED = 10, /* Only 7 bits available; max is 127 */ VENDOR_RC_NO_SUCH_COMMAND = 127, |