From 4e6a3681e1098a05a262b5482c413083d22390d9 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Wed, 26 Jun 2024 13:28:50 +0100 Subject: [PATCH] Replace MBEDTLS_MD_CAN_SHA256 in md.h, ssl.h, and entropy.h Signed-off-by: Elena Uziunaite --- include/mbedtls/ssl.h | 2 +- tf-psa-crypto/drivers/builtin/include/mbedtls/entropy.h | 2 +- tf-psa-crypto/drivers/builtin/include/mbedtls/md.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 3781b514d4..8f019c1e98 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -1153,7 +1153,7 @@ typedef void mbedtls_ssl_async_cancel_t(mbedtls_ssl_context *ssl); #if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \ !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) #define MBEDTLS_SSL_PEER_CERT_DIGEST_MAX_LEN 48 -#if defined(MBEDTLS_MD_CAN_SHA256) +#if defined(PSA_WANT_ALG_SHA_256) #define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_TYPE MBEDTLS_MD_SHA256 #define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_LEN 32 #elif defined(PSA_WANT_ALG_SHA_384) diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/entropy.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/entropy.h index 20fd6872b8..57af02ac3f 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/entropy.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/entropy.h @@ -22,7 +22,7 @@ #define MBEDTLS_ENTROPY_MD MBEDTLS_MD_SHA512 #define MBEDTLS_ENTROPY_BLOCK_SIZE 64 /**< Block size of entropy accumulator (SHA-512) */ #else -#if defined(MBEDTLS_MD_CAN_SHA256) +#if defined(PSA_WANT_ALG_SHA_256) #define MBEDTLS_ENTROPY_SHA256_ACCUMULATOR #define MBEDTLS_ENTROPY_MD MBEDTLS_MD_SHA256 #define MBEDTLS_ENTROPY_BLOCK_SIZE 32 /**< Block size of entropy accumulator (SHA-256) */ diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/md.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/md.h index 52946e6837..1bb9fa93e4 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/md.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/md.h @@ -71,7 +71,7 @@ typedef enum { #define MBEDTLS_MD_MAX_SIZE 64 /* longest known is SHA512 */ #elif defined(PSA_WANT_ALG_SHA_384) || defined(MBEDTLS_MD_CAN_SHA3_384) #define MBEDTLS_MD_MAX_SIZE 48 /* longest known is SHA384 */ -#elif defined(MBEDTLS_MD_CAN_SHA256) || defined(PSA_WANT_ALG_SHA3_256) +#elif defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA3_256) #define MBEDTLS_MD_MAX_SIZE 32 /* longest known is SHA256 */ #elif defined(PSA_WANT_ALG_SHA_224) || defined(MBEDTLS_MD_CAN_SHA3_224) #define MBEDTLS_MD_MAX_SIZE 28 /* longest known is SHA224 */