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>
This commit is contained in:
Manuel Pégourié-Gonnard 2023-03-28 11:57:09 +02:00
parent 1f2a587cdf
commit 1c32e37b0c

View file

@ -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 @@ static inline psa_key_usage_t mbedtls_psa_translate_cipher_operation(
/* 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 @@ static inline psa_algorithm_t mbedtls_psa_translate_md(mbedtls_md_type_t md_alg)
return 0;
}
}
#endif /* MBEDTLS_DEPRECATED_REMOVED */
/* Translations for ECC. */