mbedtls/tests
Manuel Pégourié-Gonnard 66300d6f40 Force SHA-256 for entropy in libtestdriver1
We only enable SHA-256, so let's use that.

Previously the entropy module was deciding which hash to use based on
MBEDTLS_xxx_C feature macros, and since only SHA256_C was defined in
config_test_driver.h, it used that and things worked.

However since entropy was changed to use MD light, and
MBEDTLS_MD_CAN_xxx feature macros, we had an issue: when building
libtestdriver1 with its default config, MBEDTLS_PSA_ACCEL_ALG_SHA_512 is
defined even though there's no actual accelerator in the build. (This is
done so that PSA_WANT_ALG_SHA_512 can remain defined in order to match
the application's config, while not defining
MBEDTLS_PSA_BUILTIN_ALG_SHA_512 in order to only include what we need in
the build of libtestdriver1.) This will cause MD to dispatch to PSA in
order to take advantage of the accelerator, which will then fail because
there is no accelerator not builtin for this hash.

In the long-term, perhaps it would be best to address the root of the
issue: defining MBEDTLS_PSA_ACCEL_ALG_SHA_512 in a build that doesn't
actually have a SHA-512 accelerator is a lie. But that would require
significant changes in libtestdriver1. So for now, just fix the most
obvious symptom (picking a non-supported hash in entropy.h) by forcing
the choice of hash to match what's in the libtestdriver1 config.

Note: if the copy of entropy module in libtestdriver1 doesn't work,
we'll get a failure when calling libtestdriver1_psa_crypto_init(), which
we do, from mbedtls_test_transparent_init(), indirectly called by our
psa_crypto_init() which will then fail.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
..
.jenkins
configs Explicitly disable all DTLS options in tls13-only.h 2023-03-01 19:49:58 +01:00
data_files Merge pull request #7009 from mprse/csr_write_san 2023-03-17 10:07:27 +00:00
docker/bionic Point to docker images used in the CI 2022-12-15 10:08:26 +01:00
git-scripts Fix typographical errors in .md files found by cspell 2022-07-29 13:44:01 +01:00
include Force SHA-256 for entropy in libtestdriver1 2023-03-24 10:43:40 +01:00
opt-testcases ssl-opt: remove redundant ECDSA dependencies in TLS1.3 tests 2023-03-06 14:48:39 +01:00
scripts Test entropy.c with driver-only hashes 2023-03-24 10:43:40 +01:00
src Remove legacy_or_psa.h 2023-03-21 16:29:31 +01:00
suites Fix driver_wrappers test 2023-03-24 10:43:40 +01:00
.gitignore Test the PSA alternative header configuration macros 2023-02-23 17:18:33 +01:00
CMakeLists.txt Fix build errors in CMake 2023-03-13 19:20:42 +08:00
compat-in-docker.sh Use OPENSSL everywhere, not OPENSSL_CMD 2022-12-19 11:42:12 +01:00
compat.sh Update some comments 2023-02-23 16:03:56 +08:00
context-info.sh Modifies tests in context-info.sh 2021-06-16 16:19:53 +01:00
Descriptions.txt
make-in-docker.sh Point to docker images used in the CI 2022-12-15 10:08:26 +01:00
Makefile Fix build errors in CMake 2023-03-13 19:20:42 +08:00
ssl-opt-in-docker.sh Use OPENSSL everywhere, not OPENSSL_CMD 2022-12-19 11:42:12 +01:00
ssl-opt.sh ssl-opt: remove leftover debug commands and fix comment 2023-03-20 14:02:07 +01:00