1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-09 14:01:18 +03:00

tests: psa: Refine choice of default hash algorithm for signature

As PSA signatures rely on built-in hash implementations
(cannot take an advantage of an accelerator for the
time being), chose an available built-in hash for
tests exercising a signature key.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2021-08-31 19:08:55 +02:00
parent 403c15cb51
commit 4c0ec7651b
2 changed files with 30 additions and 2 deletions

View File

@@ -309,8 +309,8 @@ static int exercise_signature_key( mbedtls_svc_key_id_t key,
/* If the policy allows signing with any hash, just pick one. */
if( PSA_ALG_IS_SIGN_HASH( alg ) && hash_alg == PSA_ALG_ANY_HASH )
{
#if defined(KNOWN_SUPPORTED_HASH_ALG)
hash_alg = KNOWN_SUPPORTED_HASH_ALG;
#if defined(KNOWN_MBEDTLS_SUPPORTED_HASH_ALG)
hash_alg = KNOWN_MBEDTLS_SUPPORTED_HASH_ALG;
alg ^= PSA_ALG_ANY_HASH ^ hash_alg;
#else
TEST_ASSERT( ! "No hash algorithm for hash-and-sign testing" );