From 34b0ad0bbf1d6f9f336069b076ccd69de09d2d87 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 1 Jul 2020 01:11:36 +0200 Subject: [PATCH] (mbedtls) Cleanups --- deps/mbedtls/mbedtls/check_config.h | 5 ----- deps/mbedtls/mbedtls/compat-1.3.h | 6 ------ deps/mbedtls/mbedtls/config.h | 22 ---------------------- deps/mbedtls/mbedtls/platform.h | 8 +------- deps/mbedtls/platform.c | 4 ++-- 5 files changed, 3 insertions(+), 42 deletions(-) diff --git a/deps/mbedtls/mbedtls/check_config.h b/deps/mbedtls/mbedtls/check_config.h index fa72454e53..c2c7c4f813 100644 --- a/deps/mbedtls/mbedtls/check_config.h +++ b/deps/mbedtls/mbedtls/check_config.h @@ -397,11 +397,6 @@ #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" #endif -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ - !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) -#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" -#endif - #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" #endif diff --git a/deps/mbedtls/mbedtls/compat-1.3.h b/deps/mbedtls/mbedtls/compat-1.3.h index 52768faf72..5d7b4e42ae 100644 --- a/deps/mbedtls/mbedtls/compat-1.3.h +++ b/deps/mbedtls/mbedtls/compat-1.3.h @@ -396,9 +396,6 @@ #if defined MBEDTLS_PLATFORM_MEMORY #define POLARSSL_PLATFORM_MEMORY MBEDTLS_PLATFORM_MEMORY #endif -#if defined MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#define POLARSSL_PLATFORM_NO_STD_FUNCTIONS MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#endif #if defined MBEDTLS_PLATFORM_PRINTF_ALT #define POLARSSL_PLATFORM_PRINTF_ALT MBEDTLS_PLATFORM_PRINTF_ALT #endif @@ -420,9 +417,6 @@ #if defined MBEDTLS_PLATFORM_STD_FREE #define POLARSSL_PLATFORM_STD_FREE MBEDTLS_PLATFORM_STD_FREE #endif -#if defined MBEDTLS_PLATFORM_STD_MEM_HDR -#define POLARSSL_PLATFORM_STD_MEM_HDR MBEDTLS_PLATFORM_STD_MEM_HDR -#endif #if defined MBEDTLS_PLATFORM_STD_PRINTF #define POLARSSL_PLATFORM_STD_PRINTF MBEDTLS_PLATFORM_STD_PRINTF #endif diff --git a/deps/mbedtls/mbedtls/config.h b/deps/mbedtls/mbedtls/config.h index 76427f4192..254ce8f4df 100644 --- a/deps/mbedtls/mbedtls/config.h +++ b/deps/mbedtls/mbedtls/config.h @@ -124,27 +124,6 @@ */ #define MBEDTLS_HAVE_TIME_DATE -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -#if 0 -#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#endif - /** * \def MBEDTLS_DEPRECATED_WARNING * @@ -2661,7 +2640,6 @@ /* Platform options */ #if 0 -#define MBEDTLS_PLATFORM_STD_MEM_HDR /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ #define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ #define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ #define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ diff --git a/deps/mbedtls/mbedtls/platform.h b/deps/mbedtls/mbedtls/platform.h index 5da7c0a032..7120ba56fc 100644 --- a/deps/mbedtls/mbedtls/platform.h +++ b/deps/mbedtls/mbedtls/platform.h @@ -45,7 +45,6 @@ extern "C" { * \{ */ -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) #include #include #include @@ -78,11 +77,6 @@ extern "C" { #define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" #endif #endif /* MBEDTLS_FS_IO */ -#else /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) -#include MBEDTLS_PLATFORM_STD_MEM_HDR -#endif -#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ /* \} name SECTION: Module settings */ @@ -207,7 +201,7 @@ int mbedtls_platform_set_exit( void (*exit_func)( int status ) ); * Only enabled when the NV seed entropy source is enabled */ #if defined(MBEDTLS_ENTROPY_NV_SEED) -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO) +#if defined(MBEDTLS_FS_IO) /* Internal standard platform definitions */ int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len ); int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len ); diff --git a/deps/mbedtls/platform.c b/deps/mbedtls/platform.c index 3db2206f36..4afea8786d 100644 --- a/deps/mbedtls/platform.c +++ b/deps/mbedtls/platform.c @@ -127,7 +127,7 @@ int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time #endif /* MBEDTLS_HAVE_TIME */ #if defined(MBEDTLS_ENTROPY_NV_SEED) -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO) +#if defined(MBEDTLS_FS_IO) /* Default implementations for the platform independent seed functions use * standard libc file functions to read from and write to a pre-defined filename */ @@ -166,7 +166,7 @@ int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len ) fclose( file ); return( (int)n ); } -#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ +#endif #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) #if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ)