Formally deprecate mbedtls_psa_translate_md()
The previous informal comment was not enough to prevent it from being
used in several places in the library. This should have more effect,
considering with have builds with DEPRECATED_REMOVED.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h
index cdc20e8..f1a49ec 100644
--- a/include/mbedtls/psa_util.h
+++ b/include/mbedtls/psa_util.h
@@ -29,6 +29,8 @@
#include "mbedtls/build_info.h"
+#include "mbedtls/platform_util.h"
+
#if defined(MBEDTLS_PSA_CRYPTO_C)
#include "psa/crypto.h"
@@ -125,7 +127,8 @@
/* Note: this function should not be used from inside the library, use
* mbedtls_md_psa_alg_from_type() from the internal md_psa.h instead.
* It is kept only for compatibility in case applications were using it. */
-static inline psa_algorithm_t mbedtls_psa_translate_md(mbedtls_md_type_t md_alg)
+#if !defined(MBEDTLS_DEPRECATED_REMOVED)
+static inline MBEDTLS_DEPRECATED psa_algorithm_t mbedtls_psa_translate_md(mbedtls_md_type_t md_alg)
{
switch (md_alg) {
#if defined(MBEDTLS_MD5_C) || defined(PSA_WANT_ALG_MD5)
@@ -162,6 +165,7 @@
return 0;
}
}
+#endif /* MBEDTLS_DEPRECATED_REMOVED */
/* Translations for ECC. */