Deprecate Mbed TLS cryptography API
The PSA Crypto API should be used instead. The Mbed TLS cryptography API
will still remain available under MBEDTLS_DEPRECATED_REMOVED, as Mbed
Crypto (which implements the PSA Crypto API) continues to rely on this
now internal API.
Functions in that are already considered internal and are not deprecated
by this commit. We already have the freedom to change or remove these
internal APIs.
Document the relationship between Mbed Crypto and Mbed TLS, describing
Mbed Crypto's dual purpose of providing both deprecated Mbed TLS
cryptography APIs and the PSA Crypto API.
diff --git a/include/mbedtls/memory_buffer_alloc.h b/include/mbedtls/memory_buffer_alloc.h
index 8e77f6f..7b2f86c 100644
--- a/include/mbedtls/memory_buffer_alloc.h
+++ b/include/mbedtls/memory_buffer_alloc.h
@@ -30,6 +30,7 @@
#include MBEDTLS_CONFIG_FILE
#endif
+#include "mbedtls/platform_util.h"
#include <stddef.h>
/**
@@ -70,11 +71,13 @@
* \param buf buffer to use as heap
* \param len size of the buffer
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len );
/**
* \brief Free the mutex for thread-safety and clear remaining memory
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_alloc_free( void );
/**
@@ -85,6 +88,7 @@
* \param verify One of MBEDTLS_MEMORY_VERIFY_NONE, MBEDTLS_MEMORY_VERIFY_ALLOC,
* MBEDTLS_MEMORY_VERIFY_FREE or MBEDTLS_MEMORY_VERIFY_ALWAYS
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_set_verify( int verify );
#if defined(MBEDTLS_MEMORY_DEBUG)
@@ -94,6 +98,7 @@
* Prints out a list of 'still allocated' blocks and their stack
* trace if MBEDTLS_MEMORY_BACKTRACE is defined.
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_alloc_status( void );
/**
@@ -104,11 +109,13 @@
* into smaller blocks but larger than the requested size.
* \param max_blocks Peak number of blocks in use, including free and used
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_alloc_max_get( size_t *max_used, size_t *max_blocks );
/**
* \brief Reset peak statistics
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_alloc_max_reset( void );
/**
@@ -119,6 +126,7 @@
* into smaller blocks but larger than the requested size.
* \param cur_blocks Current number of blocks in use, including free and used
*/
+MBEDTLS_DEPRECATED
void mbedtls_memory_buffer_alloc_cur_get( size_t *cur_used, size_t *cur_blocks );
#endif /* MBEDTLS_MEMORY_DEBUG */
@@ -133,6 +141,7 @@
*
* \return 0 if verified, 1 otherwise
*/
+MBEDTLS_DEPRECATED
int mbedtls_memory_buffer_alloc_verify( void );
#if defined(MBEDTLS_SELF_TEST)
@@ -141,6 +150,7 @@
*
* \return 0 if successful, or 1 if a test failed
*/
+MBEDTLS_DEPRECATED
int mbedtls_memory_buffer_alloc_self_test( int verbose );
#endif