diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2019-02-06 15:55:45 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-02-25 14:23:58 +0100 |
commit | 65551e69a006c496fb18d8374389b7b3617c2076 (patch) | |
tree | 860fbcb8626704ac230d88ff5db1acd2f7007397 /core/crypto | |
parent | b7da54b3f039908dacf92a4719b9206ffc5644d3 (diff) |
libutee: TEE_MemCompare(): use constant time algorithm
TEE_MemCompare() currently calls memcmp() which returns as soon as a
difference is found in the compared buffers. The fact that the
comparison is not constant time for a given buffer size can reveal
information on the buffer content and lead to side-channel attacks.
Although the GlobalPlatform TEE Internal Core API specification says
nothing about this timing aspect, it is unsafe not to propose a constant
time implementation to TAs. A member of the GP specification working
group confirmed in an informal discussion.
Therefore, replace memcmp() with consttime_memcmp() for constant time
comparison. If a TA needs the fastest possible buffer comparison it can
call the C library function memcmp() (from <string.h>), which we provide
in libutils.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reported-by: Bastien Simondi <bsimondi@netflix.com> [3.2]
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Diffstat (limited to 'core/crypto')
0 files changed, 0 insertions, 0 deletions