From d6048a459c1c9bc1ff9cde27dadf7a9966d14a26 Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Mon, 10 Jun 2024 13:53:08 +0100 Subject: [PATCH] We want the PSA hash code if MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C Signed-off-by: Tom Cosgrove --- programs/psa/psa_hash.c | 5 +++-- tests/psa-client-server/psasim/src/aut_psa_hash_compute.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/programs/psa/psa_hash.c b/programs/psa/psa_hash.c index c5244d6d40..6c2c07e062 100644 --- a/programs/psa/psa_hash.c +++ b/programs/psa/psa_hash.c @@ -30,11 +30,12 @@ * If you switch to a different algorithm you will need to update * the hash data in the EXAMPLE_HASH_VALUE macro below. */ -#if !defined(MBEDTLS_PSA_CRYPTO_C) || !defined(PSA_WANT_ALG_SHA_256) +#if !defined(MBEDTLS_PSA_CRYPTO_CLIENT) && \ + (!defined(MBEDTLS_PSA_CRYPTO_C) || !defined(PSA_WANT_ALG_SHA_256)) int main(void) { mbedtls_printf("MBEDTLS_PSA_CRYPTO_C and PSA_WANT_ALG_SHA_256" - "not defined.\r\n"); + "not defined, and not MBEDTLS_PSA_CRYPTO_CLIENT.\r\n"); return EXIT_SUCCESS; } #else diff --git a/tests/psa-client-server/psasim/src/aut_psa_hash_compute.c b/tests/psa-client-server/psasim/src/aut_psa_hash_compute.c index 519c0721f7..70c3e5be4f 100644 --- a/tests/psa-client-server/psasim/src/aut_psa_hash_compute.c +++ b/tests/psa-client-server/psasim/src/aut_psa_hash_compute.c @@ -32,11 +32,12 @@ * If you switch to a different algorithm you will need to update * the hash data in the EXAMPLE_HASH_VALUE macro below. */ -#if !defined(MBEDTLS_PSA_CRYPTO_C) || !defined(PSA_WANT_ALG_SHA_256) +#if !defined(MBEDTLS_PSA_CRYPTO_CLIENT) && \ + (!defined(MBEDTLS_PSA_CRYPTO_C) || !defined(PSA_WANT_ALG_SHA_256)) int main(void) { mbedtls_printf("MBEDTLS_PSA_CRYPTO_C and PSA_WANT_ALG_SHA_256" - "not defined.\r\n"); + "not defined, and not MBEDTLS_PSA_CRYPTO_CLIENT.\r\n"); return EXIT_SUCCESS; } #else