stdlib: Import timingsafe_bcmp() from FreeBSD
Some side-channel attacks involve an attacker inferring something from
the time taken for a memory compare operation to complete, for example
when comparing hashes during image authentication. To mitigate this,
timingsafe_bcmp() must be used for such operations instead of the
standard memcmp().

This function executes in constant time and so doesn't leak any timing
information to the caller.

Change-Id: I470a723dc3626a0ee6d5e3f7fd48d0a57b8aa5fd
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
1 parent 3443866 commit aa050a7bdb943ca94ab914f2a9dc508e09a57431
@Antonio Nino Diaz Antonio Nino Diaz authored on 16 Jan 2017
Showing 3 changed files
View
include/lib/stdlib/string.h
View
lib/stdlib/stdlib.mk
View
lib/stdlib/timingsafe_bcmp.c 0 → 100644