Introduce getter function for renego_status

While not strictly related to this PR, this change improves readability in
some resumption-related runtime conditions that previously had rather ugly
preprocessor directives in the middle of already complex predicates.
This commit is contained in:
Manuel Pégourié-Gonnard
2019-07-01 12:20:54 +02:00
parent 3652e99100
commit 754b9f32db
3 changed files with 32 additions and 45 deletions

View File

@@ -1127,4 +1127,15 @@ static inline int mbedtls_ssl_handshake_get_resume(
#endif
}
static inline int mbedtls_ssl_get_renego_status(
const mbedtls_ssl_context *ssl )
{
#if defined(MBEDTLS_SSL_RENEGOTIATION)
return( ssl->renego_status );
#else
(void) ssl;
return( MBEDTLS_SSL_INITIAL_HANDSHAKE );
#endif
}
#endif /* ssl_internal.h */