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 /test/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 'test/fpsensor.c')
-rw-r--r-- | test/fpsensor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/fpsensor.c b/test/fpsensor.c index c06a08d69b..33998b6b00 100644 --- a/test/fpsensor.c +++ b/test/fpsensor.c @@ -89,7 +89,7 @@ test_static int test_derive_encryption_key_failure_seed_not_set(void) /* THEN derivation will fail. */ TEST_ASSERT(derive_encryption_key(unused_key, unused_salt) == - EC_RES_ERROR); + EC_ERROR_ACCESS_DENIED); return EC_SUCCESS; } @@ -108,7 +108,7 @@ static int test_derive_encryption_key_raw(const uint32_t *user_id_, memcpy(user_id, user_id_, sizeof(user_id)); rv = derive_encryption_key(key, salt); - TEST_ASSERT(rv == EC_RES_SUCCESS); + TEST_ASSERT(rv == EC_SUCCESS); TEST_ASSERT_ARRAY_EQ(key, expected_key, sizeof(key)); return EC_SUCCESS; @@ -178,7 +178,7 @@ test_static int test_derive_encryption_key_failure_rollback_fail(void) rollback_should_fail = 1; /* THEN the derivation will fail. */ TEST_ASSERT(derive_encryption_key(unused_key, unused_salt) == - EC_RES_ERROR); + EC_ERROR_HW_INTERNAL); /* GIVEN that reading the rollback secret will succeed. */ rollback_should_fail = 0; @@ -186,7 +186,7 @@ test_static int test_derive_encryption_key_failure_rollback_fail(void) TEST_ASSERT(fp_tpm_seed_is_set()); /* THEN the derivation will succeed. */ TEST_ASSERT(derive_encryption_key(unused_key, unused_salt) == - EC_RES_SUCCESS); + EC_SUCCESS); return EC_SUCCESS; } |