Provide serialisation API only if it's enabled

This commit is contained in:
Manuel Pégourié-Gonnard 2019-07-23 16:13:17 +02:00
parent 73a4636ca4
commit 4c1d06e429
2 changed files with 4 additions and 0 deletions

View file

@ -3893,6 +3893,7 @@ int mbedtls_ssl_close_notify( mbedtls_ssl_context *ssl );
*/ */
void mbedtls_ssl_free( 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. * \brief Save an active connection as serialized data in a buffer.
* This allows the freeing or re-using of the SSL context * This allows the freeing or re-using of the SSL context
@ -4014,6 +4015,7 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl,
int mbedtls_ssl_context_load( mbedtls_ssl_context *ssl, int mbedtls_ssl_context_load( mbedtls_ssl_context *ssl,
const unsigned char *buf, const unsigned char *buf,
size_t len ); size_t len );
#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */
/** /**
* \brief Initialize an SSL configuration context * \brief Initialize an SSL configuration context

View file

@ -10719,6 +10719,7 @@ void mbedtls_ssl_session_free( mbedtls_ssl_session *session )
mbedtls_platform_zeroize( session, sizeof( mbedtls_ssl_session ) ); mbedtls_platform_zeroize( session, sizeof( mbedtls_ssl_session ) );
} }
#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
static unsigned char ssl_serialized_context_header[] = { static unsigned char ssl_serialized_context_header[] = {
MBEDTLS_VERSION_MAJOR, MBEDTLS_VERSION_MAJOR,
MBEDTLS_VERSION_MINOR, MBEDTLS_VERSION_MINOR,
@ -11270,6 +11271,7 @@ int mbedtls_ssl_context_load( mbedtls_ssl_context *context,
return( ret ); return( ret );
} }
#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */
/* /*
* Free an SSL context * Free an SSL context