From 5c0e377532c456020322dc126ca8a70f4a1da852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 23 Jul 2019 16:13:17 +0200 Subject: [PATCH] Provide serialisation API only if it's enabled --- include/mbedtls/ssl.h | 2 ++ library/ssl_tls.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 272c3b920..118263809 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -3879,6 +3879,7 @@ int mbedtls_ssl_close_notify( mbedtls_ssl_context *ssl ); */ void mbedtls_ssl_free( mbedtls_ssl_context *ssl ); +#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) /** * \brief Save an active connection as serialized data in a buffer. * This allows the freeing or re-using of the SSL context @@ -4000,6 +4001,7 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl, int mbedtls_ssl_context_load( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len ); +#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */ /** * \brief Initialize an SSL configuration context diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 8212baa30..0deeb9d2f 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -11284,6 +11284,7 @@ void mbedtls_ssl_session_free( mbedtls_ssl_session *session ) mbedtls_platform_zeroize( session, sizeof( mbedtls_ssl_session ) ); } +#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) static unsigned char ssl_serialized_context_header[] = { MBEDTLS_VERSION_MAJOR, MBEDTLS_VERSION_MINOR, @@ -11829,6 +11830,7 @@ int mbedtls_ssl_context_load( mbedtls_ssl_context *context, return( ret ); } +#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */ /* * Free an SSL context