mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
[MBEDTLS] Update to version 2.16.10. CORE-17326
This commit is contained in:
parent
a01a8faa60
commit
cbda039f4f
142 changed files with 25215 additions and 6419 deletions
20
dll/3rdparty/mbedtls/memory_buffer_alloc.c
vendored
20
dll/3rdparty/mbedtls/memory_buffer_alloc.c
vendored
|
@ -56,6 +56,7 @@
|
|||
/* No need for the header guard as MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
||||
is dependent upon MBEDTLS_PLATFORM_C */
|
||||
#include "mbedtls/platform.h"
|
||||
#include "mbedtls/platform_util.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -67,11 +68,6 @@
|
|||
#include "mbedtls/threading.h"
|
||||
#endif
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
static void mbedtls_zeroize( void *v, size_t n ) {
|
||||
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
|
||||
}
|
||||
|
||||
#define MAGIC1 0xFF00AA55
|
||||
#define MAGIC2 0xEE119966
|
||||
#define MAX_BT 20
|
||||
|
@ -138,7 +134,7 @@ static void debug_header( memory_header *hdr )
|
|||
#endif
|
||||
}
|
||||
|
||||
static void debug_chain()
|
||||
static void debug_chain( void )
|
||||
{
|
||||
memory_header *cur = heap.first;
|
||||
|
||||
|
@ -205,7 +201,7 @@ static int verify_header( memory_header *hdr )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
static int verify_chain()
|
||||
static int verify_chain( void )
|
||||
{
|
||||
memory_header *prv = heap.first, *cur;
|
||||
|
||||
|
@ -529,13 +525,13 @@ void mbedtls_memory_buffer_set_verify( int verify )
|
|||
heap.verify = verify;
|
||||
}
|
||||
|
||||
int mbedtls_memory_buffer_alloc_verify()
|
||||
int mbedtls_memory_buffer_alloc_verify( void )
|
||||
{
|
||||
return verify_chain();
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
void mbedtls_memory_buffer_alloc_status()
|
||||
void mbedtls_memory_buffer_alloc_status( void )
|
||||
{
|
||||
mbedtls_fprintf( stderr,
|
||||
"Current use: %zu blocks / %zu bytes, max: %zu blocks / "
|
||||
|
@ -634,12 +630,12 @@ void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len )
|
|||
heap.first_free = heap.first;
|
||||
}
|
||||
|
||||
void mbedtls_memory_buffer_alloc_free()
|
||||
void mbedtls_memory_buffer_alloc_free( void )
|
||||
{
|
||||
#if defined(MBEDTLS_THREADING_C)
|
||||
mbedtls_mutex_free( &heap.mutex );
|
||||
#endif
|
||||
mbedtls_zeroize( &heap, sizeof(buffer_alloc_ctx) );
|
||||
mbedtls_platform_zeroize( &heap, sizeof(buffer_alloc_ctx) );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
@ -654,7 +650,7 @@ static int check_pointer( void *p )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
static int check_all_free( )
|
||||
static int check_all_free( void )
|
||||
{
|
||||
if(
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue