From f1a8c07dfe0d6fac4de387d88c52526e83fdb2ce Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 1 Jul 2020 04:50:31 +0200 Subject: [PATCH] (deps/mbedtls) Cleanups --- Makefile.common | 1 - deps/mbedtls/asn1write.c | 4 - deps/mbedtls/bignum.c | 3 - deps/mbedtls/cipher.c | 4 - deps/mbedtls/cipher_wrap.c | 8 +- deps/mbedtls/dhm.c | 3 - deps/mbedtls/ecp.c | 10 +- deps/mbedtls/mbedtls/aes.h | 7 +- deps/mbedtls/mbedtls/check_config.h | 158 ---------------------------- deps/mbedtls/mbedtls/compat-1.3.h | 3 - deps/mbedtls/mbedtls/config.h | 32 ------ deps/mbedtls/md.c | 4 - deps/mbedtls/md_wrap.c | 3 - deps/mbedtls/net_sockets.c | 7 +- deps/mbedtls/pem.c | 6 +- deps/mbedtls/pk_wrap.c | 4 - deps/mbedtls/pkcs5.c | 6 +- deps/mbedtls/pkparse.c | 3 - deps/mbedtls/pkwrite.c | 3 - deps/mbedtls/platform.c | 79 -------------- deps/mbedtls/rsa.c | 8 +- deps/mbedtls/ssl_cache.c | 6 +- deps/mbedtls/ssl_ciphersuites.c | 7 +- deps/mbedtls/ssl_cli.c | 9 +- deps/mbedtls/ssl_cookie.c | 4 - deps/mbedtls/ssl_srv.c | 6 +- griffin/griffin.c | 1 - 27 files changed, 14 insertions(+), 375 deletions(-) delete mode 100644 deps/mbedtls/platform.c diff --git a/Makefile.common b/Makefile.common index cbbd12015d..8bcd0c6a0e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -535,7 +535,6 @@ ifeq ($(HAVE_BUILTINMBEDTLS), 1) deps/mbedtls/pkcs5.o \ deps/mbedtls/pkparse.o \ deps/mbedtls/pkwrite.o \ - deps/mbedtls/platform.o \ deps/mbedtls/ripemd160.o \ deps/mbedtls/rsa.o \ deps/mbedtls/sha1.o \ diff --git a/deps/mbedtls/asn1write.c b/deps/mbedtls/asn1write.c index e5beab50a6..b48d87085f 100644 --- a/deps/mbedtls/asn1write.c +++ b/deps/mbedtls/asn1write.c @@ -30,10 +30,6 @@ #include "mbedtls/asn1write.h" #include - -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) diff --git a/deps/mbedtls/bignum.c b/deps/mbedtls/bignum.c index 01502af445..d887d2928a 100644 --- a/deps/mbedtls/bignum.c +++ b/deps/mbedtls/bignum.c @@ -48,9 +48,6 @@ #include -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include #include diff --git a/deps/mbedtls/cipher.c b/deps/mbedtls/cipher.c index c4df5faa7a..a075b51d5d 100644 --- a/deps/mbedtls/cipher.c +++ b/deps/mbedtls/cipher.c @@ -45,10 +45,6 @@ #include "mbedtls/ccm.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif - #if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) #define MBEDTLS_CIPHER_MODE_STREAM #endif diff --git a/deps/mbedtls/cipher_wrap.c b/deps/mbedtls/cipher_wrap.c index 21944fca26..2e9a5fb6d2 100644 --- a/deps/mbedtls/cipher_wrap.c +++ b/deps/mbedtls/cipher_wrap.c @@ -61,14 +61,8 @@ #include "mbedtls/ccm.h" #endif -#if defined(MBEDTLS_CIPHER_NULL_CIPHER) -#include -#endif - -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include +#include #if defined(MBEDTLS_GCM_C) /* shared by all GCM ciphers */ diff --git a/deps/mbedtls/dhm.c b/deps/mbedtls/dhm.c index 1953f9b9d0..e70a1fb755 100644 --- a/deps/mbedtls/dhm.c +++ b/deps/mbedtls/dhm.c @@ -47,9 +47,6 @@ #include "mbedtls/asn1.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include #include diff --git a/deps/mbedtls/ecp.c b/deps/mbedtls/ecp.c index eedbedacee..8de5b61705 100644 --- a/deps/mbedtls/ecp.c +++ b/deps/mbedtls/ecp.c @@ -55,18 +55,12 @@ #if !defined(MBEDTLS_ECP_ALT) -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include #include -#include "mbedtls/ecp_internal.h" +#include -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif +#include "mbedtls/ecp_internal.h" #include "arc4_alt.h" diff --git a/deps/mbedtls/mbedtls/aes.h b/deps/mbedtls/mbedtls/aes.h index 47de110add..b58c2180ad 100644 --- a/deps/mbedtls/mbedtls/aes.h +++ b/deps/mbedtls/mbedtls/aes.h @@ -32,6 +32,8 @@ #include #include +#include + /* padlock.c and aesni.c rely on these values! */ #define MBEDTLS_AES_ENCRYPT 1 #define MBEDTLS_AES_DECRYPT 0 @@ -39,11 +41,6 @@ #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020 /**< Invalid key length. */ #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022 /**< Invalid data input length. */ -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - #if !defined(MBEDTLS_AES_ALT) /* Regular implementation */ diff --git a/deps/mbedtls/mbedtls/check_config.h b/deps/mbedtls/mbedtls/check_config.h index e07c668f44..ceac24ab27 100644 --- a/deps/mbedtls/mbedtls/check_config.h +++ b/deps/mbedtls/mbedtls/check_config.h @@ -38,19 +38,6 @@ #error "mbed TLS requires a platform with 8-bit chars" #endif -#if defined(_WIN32) -#if !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_C is required on Windows" -#endif - -/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as - * it would confuse config.pl. */ -#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ - !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) -#define MBEDTLS_PLATFORM_SNPRINTF_ALT -#endif -#endif /* _WIN32 */ - #if defined(TARGET_LIKE_MBED) && \ ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) ) #error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" @@ -235,151 +222,6 @@ #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" #endif -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ - defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_FREE) -#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_CALLOC) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) -#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ - defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ - defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_CALLOC 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 - -#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ - ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ - !defined(MBEDTLS_PLATFORM_PRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" -#endif - #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ !defined(MBEDTLS_OID_C) ) #error "MBEDTLS_RSA_C defined, but not all prerequisites" diff --git a/deps/mbedtls/mbedtls/compat-1.3.h b/deps/mbedtls/mbedtls/compat-1.3.h index 2be783ebbe..725299241b 100644 --- a/deps/mbedtls/mbedtls/compat-1.3.h +++ b/deps/mbedtls/mbedtls/compat-1.3.h @@ -315,9 +315,6 @@ #if defined MBEDTLS_PK_WRITE_C #define POLARSSL_PK_WRITE_C MBEDTLS_PK_WRITE_C #endif -#if defined MBEDTLS_PLATFORM_C -#define POLARSSL_PLATFORM_C MBEDTLS_PLATFORM_C -#endif #if defined MBEDTLS_PLATFORM_EXIT_ALT #define POLARSSL_PLATFORM_EXIT_ALT MBEDTLS_PLATFORM_EXIT_ALT #endif diff --git a/deps/mbedtls/mbedtls/config.h b/deps/mbedtls/mbedtls/config.h index c6ea65a9fd..6c44d604a7 100644 --- a/deps/mbedtls/mbedtls/config.h +++ b/deps/mbedtls/mbedtls/config.h @@ -1849,26 +1849,6 @@ */ #define MBEDTLS_PKCS12_C -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other module rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - /** * \def MBEDTLS_RIPEMD160_C * @@ -2259,18 +2239,6 @@ #define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ #endif -/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -#if 0 -#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ -#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ -#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ -#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ -#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -#endif - /* SSL Cache options */ #if 0 #define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ diff --git a/deps/mbedtls/md.c b/deps/mbedtls/md.c index 81b490c4f0..812019677d 100644 --- a/deps/mbedtls/md.c +++ b/deps/mbedtls/md.c @@ -34,11 +34,7 @@ #include "mbedtls/md.h" #include "mbedtls/md_internal.h" -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include - #include #if defined(MBEDTLS_FS_IO) diff --git a/deps/mbedtls/md_wrap.c b/deps/mbedtls/md_wrap.c index 55fca867ff..984a35f9f1 100644 --- a/deps/mbedtls/md_wrap.c +++ b/deps/mbedtls/md_wrap.c @@ -53,9 +53,6 @@ #include "mbedtls/sha512.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include #if defined(MBEDTLS_MD5_C) diff --git a/deps/mbedtls/net_sockets.c b/deps/mbedtls/net_sockets.c index 4966270814..8818f13116 100644 --- a/deps/mbedtls/net_sockets.c +++ b/deps/mbedtls/net_sockets.c @@ -36,16 +36,11 @@ #error "This module only works on Unix and Windows, see MBEDTLS_NET_C in config.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#else #include -#endif +#include #include "mbedtls/net_sockets.h" -#include - #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \ !defined(EFI32) diff --git a/deps/mbedtls/pem.c b/deps/mbedtls/pem.c index df1202a070..70ce7887ac 100644 --- a/deps/mbedtls/pem.c +++ b/deps/mbedtls/pem.c @@ -34,12 +34,8 @@ #include "mbedtls/md5.h" #include "mbedtls/cipher.h" -#include - -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include +#include #if defined(MBEDTLS_PEM_PARSE_C) #include "arc4_alt.h" diff --git a/deps/mbedtls/pk_wrap.c b/deps/mbedtls/pk_wrap.c index 53e4929f9b..e92bae0ac1 100644 --- a/deps/mbedtls/pk_wrap.c +++ b/deps/mbedtls/pk_wrap.c @@ -42,11 +42,7 @@ #include "mbedtls/ecdsa.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include - #include #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) diff --git a/deps/mbedtls/pkcs5.c b/deps/mbedtls/pkcs5.c index c2d348577c..c4f6df4f08 100644 --- a/deps/mbedtls/pkcs5.c +++ b/deps/mbedtls/pkcs5.c @@ -42,12 +42,8 @@ #include "mbedtls/cipher.h" #include "mbedtls/oid.h" -#include - -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include +#include static int pkcs5_parse_pbkdf2_params( const mbedtls_asn1_buf *params, mbedtls_asn1_buf *salt, int *iterations, diff --git a/deps/mbedtls/pkparse.c b/deps/mbedtls/pkparse.c index bccd5cc1c6..dae2e1efdf 100644 --- a/deps/mbedtls/pkparse.c +++ b/deps/mbedtls/pkparse.c @@ -52,9 +52,6 @@ #include "mbedtls/pkcs12.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include #if defined(MBEDTLS_FS_IO) diff --git a/deps/mbedtls/pkwrite.c b/deps/mbedtls/pkwrite.c index 0184c68101..efbc323176 100644 --- a/deps/mbedtls/pkwrite.c +++ b/deps/mbedtls/pkwrite.c @@ -46,9 +46,6 @@ #include "mbedtls/pem.h" #endif -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include #if defined(MBEDTLS_RSA_C) diff --git a/deps/mbedtls/platform.c b/deps/mbedtls/platform.c deleted file mode 100644 index ca98bc0052..0000000000 --- a/deps/mbedtls/platform.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Platform abstraction layer - * - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_PLATFORM_C) - -#include "mbedtls/platform.h" - -#if defined(MBEDTLS_HAVE_TIME) - -#if defined(MBEDTLS_PLATFORM_TIME_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_TIME) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static mbedtls_time_t platform_time_uninit( mbedtls_time_t* timer ) -{ - ((void) timer); - return( 0 ); -} - -#define MBEDTLS_PLATFORM_STD_TIME platform_time_uninit -#endif /* !MBEDTLS_PLATFORM_STD_TIME */ - -mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* timer ) = MBEDTLS_PLATFORM_STD_TIME; - -int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* timer ) ) -{ - mbedtls_time = time_func; - return( 0 ); -} -#endif /* MBEDTLS_PLATFORM_TIME_ALT */ - -#endif /* MBEDTLS_HAVE_TIME */ - -#if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) -/* - * Placeholder platform setup that does nothing by default - */ -int mbedtls_platform_setup( mbedtls_platform_context *ctx ) -{ - (void)ctx; - - return( 0 ); -} - -/* - * Placeholder platform teardown that does nothing by default - */ -void mbedtls_platform_teardown( mbedtls_platform_context *ctx ) -{ - (void)ctx; -} -#endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ - -#endif /* MBEDTLS_PLATFORM_C */ diff --git a/deps/mbedtls/rsa.c b/deps/mbedtls/rsa.c index 9a65080ccc..fb19f441ce 100644 --- a/deps/mbedtls/rsa.c +++ b/deps/mbedtls/rsa.c @@ -53,14 +53,8 @@ #include "mbedtls/md.h" #endif -#if defined(MBEDTLS_PKCS1_V15) && !defined(__OpenBSD__) -#include -#endif - -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include +#include #include "arc4_alt.h" diff --git a/deps/mbedtls/ssl_cache.c b/deps/mbedtls/ssl_cache.c index 5d2479e5c3..3c02ecc483 100644 --- a/deps/mbedtls/ssl_cache.c +++ b/deps/mbedtls/ssl_cache.c @@ -31,15 +31,11 @@ #if defined(MBEDTLS_SSL_CACHE_C) -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include +#include #include "mbedtls/ssl_cache.h" -#include - void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache ) { memset( cache, 0, sizeof( mbedtls_ssl_cache_context ) ); diff --git a/deps/mbedtls/ssl_ciphersuites.c b/deps/mbedtls/ssl_ciphersuites.c index ed3f20c9fd..a7be9db63b 100644 --- a/deps/mbedtls/ssl_ciphersuites.c +++ b/deps/mbedtls/ssl_ciphersuites.c @@ -29,17 +29,12 @@ #if defined(MBEDTLS_SSL_TLS_C) -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#else #include -#endif +#include #include "mbedtls/ssl_ciphersuites.h" #include "mbedtls/ssl.h" -#include - /* * Ordered from most preferred to least preferred in terms of security. * diff --git a/deps/mbedtls/ssl_cli.c b/deps/mbedtls/ssl_cli.c index 5c9c6fdae9..c75171c7d9 100644 --- a/deps/mbedtls/ssl_cli.c +++ b/deps/mbedtls/ssl_cli.c @@ -27,19 +27,14 @@ #if defined(MBEDTLS_SSL_CLI_C) -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif +#include #include +#include #include "mbedtls/debug.h" #include "mbedtls/ssl.h" #include "mbedtls/ssl_internal.h" -#include - -#include - #if defined(MBEDTLS_HAVE_TIME) #include "mbedtls/platform_time.h" #endif diff --git a/deps/mbedtls/ssl_cookie.c b/deps/mbedtls/ssl_cookie.c index ae3255a2ce..a1990b8679 100644 --- a/deps/mbedtls/ssl_cookie.c +++ b/deps/mbedtls/ssl_cookie.c @@ -31,10 +31,6 @@ #if defined(MBEDTLS_SSL_COOKIE_C) -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif - #include "mbedtls/ssl_cookie.h" #include "mbedtls/ssl_internal.h" diff --git a/deps/mbedtls/ssl_srv.c b/deps/mbedtls/ssl_srv.c index 561823664d..addcb7d894 100644 --- a/deps/mbedtls/ssl_srv.c +++ b/deps/mbedtls/ssl_srv.c @@ -27,17 +27,13 @@ #if defined(MBEDTLS_SSL_SRV_C) -#if defined(MBEDTLS_PLATFORM_C) -#include "mbedtls/platform.h" -#endif #include +#include #include "mbedtls/debug.h" #include "mbedtls/ssl.h" #include "mbedtls/ssl_internal.h" -#include - #if defined(MBEDTLS_ECP_C) #include "mbedtls/ecp.h" #endif diff --git a/griffin/griffin.c b/griffin/griffin.c index de668c353e..1179ba257d 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -1557,7 +1557,6 @@ SSL #include "../deps/mbedtls/pkcs5.c" #include "../deps/mbedtls/pkparse.c" #include "../deps/mbedtls/pkwrite.c" -#include "../deps/mbedtls/platform.c" #include "../deps/mbedtls/ripemd160.c" #include "../deps/mbedtls/rsa.c" #include "../deps/mbedtls/sha1.c"