Add getter function for handshake->resume
This makes the code more readable by having fewer #ifdefs all over the place.
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index 083ea31..6731b97 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -888,11 +888,7 @@
#if defined(MBEDTLS_SSL_RENEGOTIATION)
ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE ||
#endif
-#if !defined(MBEDTLS_SSL_NO_SESSION_RESUMPTION)
- ssl->handshake->resume == 0 )
-#else /* !MBEDTLS_SSL_NO_SESSION_RESUMPTION */
- 0 )
-#endif
+ mbedtls_ssl_handshake_get_resume( ssl->handshake ) == 0 )
{
n = 0;
}
@@ -1839,10 +1835,8 @@
memcpy( ssl->session_negotiate->id, buf + 35, n );
}
-#if !defined(MBEDTLS_SSL_NO_SESSION_RESUMPTION)
MBEDTLS_SSL_DEBUG_MSG( 3, ( "%s session has been resumed",
- ssl->handshake->resume ? "a" : "no" ) );
-#endif /* !MBEDTLS_SSL_NO_SESSION_RESUMPTION */
+ mbedtls_ssl_handshake_get_resume( ssl->handshake ) ? "a" : "no" ) );
MBEDTLS_SSL_DEBUG_MSG( 3, ( "server hello, chosen ciphersuite: %04x", i ) );
MBEDTLS_SSL_DEBUG_MSG( 3, ( "server hello, compress alg.: %d", buf[37 + n] ) );