From d3138c35c68481fc9cdc1990b8108c5970b92305 Mon Sep 17 00:00:00 2001 From: Simon Butcher Date: Wed, 27 Apr 2016 01:26:50 +0100 Subject: [PATCH] Fixes SSL sample apps for non-default configs Fixes the SSL sample applications to build for the non-default configs which don't build if MBEDTLS_PLATFORM_C isn't defined. --- programs/ssl/ssl_client1.c | 3 +++ programs/ssl/ssl_client2.c | 3 +++ programs/ssl/ssl_mail_client.c | 3 +++ programs/ssl/ssl_server.c | 3 +++ programs/ssl/ssl_server2.c | 3 +++ programs/test/udp_proxy.c | 9 +++++---- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/programs/ssl/ssl_client1.c b/programs/ssl/ssl_client1.c index 1aeddf71c..3516e15c9 100644 --- a/programs/ssl/ssl_client1.c +++ b/programs/ssl/ssl_client1.c @@ -29,6 +29,9 @@ #include "mbedtls/platform.h" #else #include +#include +#define mbedtls_time time +#define mbedtls_time_t time_t #define mbedtls_fprintf fprintf #define mbedtls_printf printf #endif diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c index 559e5028d..78f9e00f5 100644 --- a/programs/ssl/ssl_client2.c +++ b/programs/ssl/ssl_client2.c @@ -29,6 +29,9 @@ #include "mbedtls/platform.h" #else #include +#include +#define mbedtls_time time +#define mbedtls_time_t time_t #define mbedtls_printf printf #define mbedtls_fprintf fprintf #define mbedtls_snprintf snprintf diff --git a/programs/ssl/ssl_mail_client.c b/programs/ssl/ssl_mail_client.c index 974c17020..c807eb569 100644 --- a/programs/ssl/ssl_mail_client.c +++ b/programs/ssl/ssl_mail_client.c @@ -29,6 +29,9 @@ #include "mbedtls/platform.h" #else #include +#include +#define mbedtls_time time +#define mbedtls_time_t time_t #define mbedtls_fprintf fprintf #define mbedtls_printf printf #endif diff --git a/programs/ssl/ssl_server.c b/programs/ssl/ssl_server.c index 70efba938..c7f526795 100644 --- a/programs/ssl/ssl_server.c +++ b/programs/ssl/ssl_server.c @@ -29,6 +29,9 @@ #include "mbedtls/platform.h" #else #include +#include +#define mbedtls_time time +#define mbedtls_time_t time_t #define mbedtls_fprintf fprintf #define mbedtls_printf printf #endif diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index b586a7008..6d4e9165b 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -29,7 +29,10 @@ #include "mbedtls/platform.h" #else #include +#include #define mbedtls_free free +#define mbedtls_time time +#define mbedtls_time_t time_t #define mbedtls_calloc calloc #define mbedtls_fprintf fprintf #define mbedtls_printf printf diff --git a/programs/test/udp_proxy.c b/programs/test/udp_proxy.c index eb8d29e71..b698c78f0 100644 --- a/programs/test/udp_proxy.c +++ b/programs/test/udp_proxy.c @@ -34,11 +34,15 @@ #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" #else +#include +#include +#include +#define mbedtls_time time +#define mbedtls_time_t time_t #define mbedtls_printf printf #endif #if !defined(MBEDTLS_NET_C) -#include int main( void ) { mbedtls_printf( "MBEDTLS_NET_C not defined.\n" ); @@ -50,10 +54,7 @@ int main( void ) #include "mbedtls/error.h" #include "mbedtls/ssl.h" -#include -#include #include -#include /* For select() */ #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \