diff options
author | Yicheng Li <yichengli@chromium.org> | 2019-07-24 17:38:23 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-26 20:49:01 +0000 |
commit | 30ab5997d7aed6c71943c9779544792695f4608f (patch) | |
tree | 9c3ce75fbde3e4f8f83a752f159a9553971614a5 /common/fpsensor/fpsensor.c | |
parent | 9ff89625dc098838a60ace547b2db4ebb27dee41 (diff) | |
download | chrome-ec-30ab5997d7aed6c71943c9779544792695f4608f.tar.gz |
fpsensor: Change crypto functions to return error code instead of result code
EC_RES_SUCCESS and EC_RES_ERROR are meant to be returned in EC command
handler to represent command result, so change crypto functions to
return EC_SUCCESS and EC error codes instead.
BRANCH=nocturne
BUG=none
TEST=make -j buildall
TEST=tested enrollment, matching, deletion and multifinger on
nocturne DUT
Change-Id: Ia98fa7469ab4e5dba00ede19dd34c5007d17b054
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715512
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Diffstat (limited to 'common/fpsensor/fpsensor.c')
-rw-r--r-- | common/fpsensor/fpsensor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/fpsensor/fpsensor.c b/common/fpsensor/fpsensor.c index 98ac892d18..facdd3c1bb 100644 --- a/common/fpsensor/fpsensor.c +++ b/common/fpsensor/fpsensor.c @@ -419,7 +419,7 @@ static int fp_command_frame(struct host_cmd_handler_args *args) exit_trng(); ret = derive_encryption_key(key, enc_info->salt); - if (ret != EC_RES_SUCCESS) { + if (ret != EC_SUCCESS) { CPRINTS("fgr%d: Failed to derive key", fgr); return EC_RES_UNAVAILABLE; } @@ -429,7 +429,7 @@ static int fp_command_frame(struct host_cmd_handler_args *args) sizeof(fp_template[0]), enc_info->nonce, FP_CONTEXT_NONCE_BYTES, enc_info->tag, FP_CONTEXT_TAG_BYTES); - if (ret != EC_RES_SUCCESS) { + if (ret != EC_SUCCESS) { CPRINTS("fgr%d: Failed to encrypt template", fgr); return EC_RES_UNAVAILABLE; } @@ -507,7 +507,7 @@ static int fp_command_template(struct host_cmd_handler_args *args) return EC_RES_INVALID_PARAM; } ret = derive_encryption_key(key, enc_info->salt); - if (ret != EC_RES_SUCCESS) { + if (ret != EC_SUCCESS) { CPRINTS("fgr%d: Failed to derive key", idx); return EC_RES_UNAVAILABLE; } @@ -517,7 +517,7 @@ static int fp_command_template(struct host_cmd_handler_args *args) sizeof(fp_template[0]), enc_info->nonce, FP_CONTEXT_NONCE_BYTES, enc_info->tag, FP_CONTEXT_TAG_BYTES); - if (ret != EC_RES_SUCCESS) { + if (ret != EC_SUCCESS) { CPRINTS("fgr%d: Failed to decipher template", idx); /* Don't leave bad data in the template buffer */ fp_clear_finger_context(idx); |