Fix compile-time guard for optional field in struct

This commit is contained in:
Manuel Pégourié-Gonnard 2019-07-02 16:21:30 +02:00
parent 1772c9fac5
commit 7b80c64de4

View file

@ -7275,10 +7275,6 @@ static void ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl )
void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl )
{
#if !defined(MBEDTLS_SSL_NO_SESSION_CACHE)
int resume = ssl->handshake->resume;
#endif /* !MBEDTLS_SSL_NO_SESSION_CACHE */
MBEDTLS_SSL_DEBUG_MSG( 3, ( "=> handshake wrapup" ) );
#if defined(MBEDTLS_SSL_RENEGOTIATION)
@ -7306,18 +7302,18 @@ void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl )
ssl->session = ssl->session_negotiate;
ssl->session_negotiate = NULL;
#if !defined(MBEDTLS_SSL_NO_SESSION_CACHE)
#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_NO_SESSION_CACHE)
/*
* Add cache entry
*/
if( ssl->conf->f_set_cache != NULL &&
ssl->session->id_len != 0 &&
resume == 0 )
ssl->handshake->resume == 0 )
{
if( ssl->conf->f_set_cache( ssl->conf->p_cache, ssl->session ) != 0 )
MBEDTLS_SSL_DEBUG_MSG( 1, ( "cache did not store session" ) );
}
#endif /* !MBEDTLS_SSL_NO_SESSION_CACHE */
#endif /* MBEDTLS_SSL_SRV_C && !MBEDTLS_SSL_NO_SESSION_CACHE */
#if defined(MBEDTLS_SSL_PROTO_DTLS)
if( MBEDTLS_SSL_TRANSPORT_IS_DTLS( ssl->conf->transport ) &&