From f000471c66b6d5c7b8ac8401e1d38d79bfdd0f7e Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Wed, 31 Aug 2022 19:10:42 -0400 Subject: [PATCH] Add missing MD dependency for pkcs5_pbkdf2_hmac Signed-off-by: Andrzej Kurek --- include/mbedtls/pkcs5.h | 2 ++ library/pkcs5.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/pkcs5.h b/include/mbedtls/pkcs5.h index dbbc4147f..cf156644d 100644 --- a/include/mbedtls/pkcs5.h +++ b/include/mbedtls/pkcs5.h @@ -90,6 +90,7 @@ int mbedtls_pkcs5_pbkdf2_hmac_ext( mbedtls_md_type_t md_type, unsigned int iteration_count, uint32_t key_length, unsigned char *output ); +#if defined(MBEDTLS_MD_C) #if !defined(MBEDTLS_DEPRECATED_REMOVED) /** * \brief PKCS#5 PBKDF2 using HMAC @@ -113,6 +114,7 @@ int MBEDTLS_DEPRECATED mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, unsigned int iteration_count, uint32_t key_length, unsigned char *output ); #endif /* !MBEDTLS_DEPRECATED_REMOVED */ +#endif /* MBEDTLS_MD_C */ #if defined(MBEDTLS_SELF_TEST) /** diff --git a/library/pkcs5.c b/library/pkcs5.c index 60ad11f77..d73f203b7 100644 --- a/library/pkcs5.c +++ b/library/pkcs5.c @@ -208,6 +208,7 @@ exit: } #endif /* MBEDTLS_ASN1_PARSE_C */ +#if defined(MBEDTLS_MD_C) #if defined(MBEDTLS_DEPRECATED_REMOVED) static #endif @@ -292,6 +293,7 @@ cleanup: return( ret ); } +#endif /* MBEDTLS_MD_C */ int mbedtls_pkcs5_pbkdf2_hmac_ext( mbedtls_md_type_t md_alg, const unsigned char *password, @@ -418,7 +420,7 @@ cleanup: ret = MBEDTLS_ERR_ERROR_GENERIC_ERROR; return ( ret ); -#endif +#endif /* !MBEDTLS_MD_C */ } #if defined(MBEDTLS_SELF_TEST)