arm-trusted-firmware/drivers/auth
Antonio Nino Diaz fabd21ad36 Revert "tbbr: Use constant-time bcmp() to compare hashes"
This reverts commit b621fb503c.

Because of the Trusted Firmware design, timing-safe functions are not
needed. Using them may be misleading as it could be interpreted as being
a protection against private data leakage, which isn't the case here.

For each image, the SHA-256 hash is calculated. Some padding is appended
and the result is encrypted with a private key using RSA-2048. This is
the signature of the image. The public key is stored along with BL1 in
read-only memory and the encrypted hash is stored in the FIP.

When authenticating an image, the TF decrypts the hash stored in the FIP
and recalculates the hash of the image. If they don't match, the boot
sequence won't continue.

A constant-time comparison does not provide additional security as all
the data involved in this process is already known to any attacker.
There is no private data that can leaked through a timing attack when
authenticating an image.

`timingsafe_bcmp()` is kept in the codebase because it could be useful
in the future.

Change-Id: I44bdcd58faa586a050cc89447e38c142508c9888
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2017-02-16 15:15:23 +00:00
..
mbedtls Revert "tbbr: Use constant-time bcmp() to compare hashes" 2017-02-16 15:15:23 +00:00
tbbr TBB: add non-volatile counter support 2016-03-31 13:29:17 +01:00
auth_mod.c tbbr: Fix updating of Non-Trusted NV counter 2016-12-15 14:12:35 +00:00
crypto_mod.c TBB: add authentication framework 2015-06-25 08:53:26 +01:00
img_parser_mod.c TBB: add authentication framework 2015-06-25 08:53:26 +01:00