aboutsummaryrefslogtreecommitdiff
path: root/core/crypto
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2019-02-14 14:54:34 +0100
committerJérôme Forissier <jerome.forissier@linaro.org>2019-02-25 14:23:58 +0100
commit48e106048dce669b9e5f334f08397923f94b2c67 (patch)
treef8812ac8d52f89dced6b159230723c6ba7eaa42f /core/crypto
parent65551e69a006c496fb18d8374389b7b3617c2076 (diff)
libutils: remove buf_compare_ct()
Now that we have consttime_memcmp(), buf_compare_ct() is redundant. Every time buf_compare_ct() is used, consttime_memcmp() may be used instead. This commit removes buf_compare_ct(). A compatibility wrapper is kept in <string_ext.h> to avoid knowingly breaking the build of any TA that may use it. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/crypto')
-rw-r--r--core/crypto/aes-gcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/crypto/aes-gcm.c b/core/crypto/aes-gcm.c
index 464369c8..0cc1e99f 100644
--- a/core/crypto/aes-gcm.c
+++ b/core/crypto/aes-gcm.c
@@ -328,7 +328,7 @@ static TEE_Result __gcm_dec_final(struct internal_aes_gcm_state *state,
if (res)
return res;
- if (buf_compare_ct(state->buf_tag, tag, tag_len))
+ if (consttime_memcmp(state->buf_tag, tag, tag_len))
return TEE_ERROR_MAC_INVALID;
return TEE_SUCCESS;