From b57a44bf9b6e99c4ecc5a6b8e9fa06a31189531e Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Mon, 6 Jun 2022 08:33:45 +0200 Subject: [PATCH] is_kdf_alg_supported: Adapt impl to new build flags for HKDF EXTRACT/EXPAND Signed-off-by: Przemek Stekiel --- library/psa_crypto.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 8c680778e3..f1c6fa4238 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -5067,10 +5067,16 @@ psa_status_t psa_key_derivation_output_key( const psa_key_attributes_t *attribut #if defined(AT_LEAST_ONE_BUILTIN_KDF) static int is_kdf_alg_supported( psa_algorithm_t kdf_alg ) { -#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF) || \ - defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT) || \ - defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXPAND) - if( PSA_ALG_IS_ANY_HKDF( kdf_alg ) ) +#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF) + if( PSA_ALG_IS_HKDF( kdf_alg ) ) + return( 1 ); +#endif +#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT) + if( PSA_ALG_IS_HKDF_EXTRACT( kdf_alg ) ) + return( 1 ); +#endif +#if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXPAND) + if( PSA_ALG_IS_HKDF_EXPAND( kdf_alg ) ) return( 1 ); #endif #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF)