Move code to reduce probability of conflicts

There are a number of PRs in flight that are going to append to the list of
getter functions for harcodeable SSL conf items, so leave that list at the end
in order to avoid conflicts between this PR and the SSL conf ones.
This commit is contained in:
Manuel Pégourié-Gonnard 2019-07-02 15:18:36 +02:00
parent c27fabfb6f
commit 1772c9fac5

View file

@ -1082,6 +1082,33 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context *ssl,
mbedtls_record *rec );
/*
* Accessor functions for optional fields of various structures
*/
static inline int mbedtls_ssl_handshake_get_resume(
const mbedtls_ssl_handshake_params *handshake )
{
#if !defined(MBEDTLS_SSL_NO_SESSION_RESUMPTION)
return( handshake->resume );
#else
(void) handshake;
return( 0 );
#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
}
/*
* Getter functions for fields in mbedtls_ssl_config which may
* be fixed at compile time via one of MBEDTLS_SSL_SSL_CONF_XXX.
@ -1111,31 +1138,4 @@ static inline unsigned int mbedtls_ssl_conf_get_ems_enforced(
}
#endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */
/*
* Accessor functions for optional fields of various structures
*/
static inline int mbedtls_ssl_handshake_get_resume(
const mbedtls_ssl_handshake_params *handshake )
{
#if !defined(MBEDTLS_SSL_NO_SESSION_RESUMPTION)
return( handshake->resume );
#else
(void) handshake;
return( 0 );
#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 */