Skip to content

Commit

Permalink
Merge pull request #157 from lhuang04/tls13_prototype_macro_mismatch
Browse files Browse the repository at this point in the history
Fix mismatched macro guard between c and header file
  • Loading branch information
Hannes Tschofenig authored Mar 15, 2021
2 parents 8d8b9cd + fd8c345 commit 62e6356
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions library/ssl_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -5850,15 +5850,17 @@ int mbedtls_ssl_get_session( const mbedtls_ssl_context *ssl,
}
#endif /* MBEDTLS_SSL_CLI_C */

#if defined(MBEDTLS_SSL_SESSION_TICKETS) || defined(MBEDTLS_SSL_NEW_SESSION_TICKET)
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_NEW_SESSION_TICKET)
const mbedtls_ssl_session *mbedtls_ssl_get_session_pointer( const mbedtls_ssl_context *ssl )
{
if( ssl == NULL )
return( NULL );

return( ssl->session );
}
#endif /* MBEDTLS_SSL_SESSION_TICKETS || defined(MBEDTLS_SSL_NEW_SESSION_TICKET */
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 || MBEDTLS_SSL_PROTO_TLS1_1 || MBEDTLS_SSL_PROTO_TLS1 ||
MBEDTLS_SSL_NEW_SESSION_TICKET */

/*
* Define ticket header determining Mbed TLS version
Expand Down Expand Up @@ -5930,17 +5932,16 @@ const mbedtls_ssl_session *mbedtls_ssl_get_session_pointer( const mbedtls_ssl_co
( SSL_SERIALIZED_SESSION_CONFIG_ETM << SSL_SERIALIZED_SESSION_CONFIG_ETM_BIT ) | \
( SSL_SERIALIZED_SESSION_CONFIG_TICKET << SSL_SERIALIZED_SESSION_CONFIG_TICKET_BIT ) ) )

#if defined(MBEDTLS_SSL_SESSION_TICKETS) || defined(MBEDTLS_SSL_NEW_SESSION_TICKET)
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_NEW_SESSION_TICKET)
static unsigned char ssl_serialized_session_header[] = {
MBEDTLS_VERSION_MAJOR,
MBEDTLS_VERSION_MINOR,
MBEDTLS_VERSION_PATCH,
( SSL_SERIALIZED_SESSION_CONFIG_BITFLAG >> 8 ) & 0xFF,
( SSL_SERIALIZED_SESSION_CONFIG_BITFLAG >> 0 ) & 0xFF,
};
#endif /* MBEDTLS_SSL_SESSION_TICKETS || defined(MBEDTLS_SSL_NEW_SESSION_TICKET */

#if defined(MBEDTLS_SSL_SESSION_TICKETS) || ( defined(MBEDTLS_SSL_NEW_SESSION_TICKET) && defined(MBEDTLS_SSL_SRV_C) )
/*
* Serialize a session in the following format:
* (in the presentation language of TLS, RFC 8446 section 3)
Expand Down Expand Up @@ -6687,7 +6688,8 @@ int mbedtls_ssl_session_load( mbedtls_ssl_session *session,

return( ret );
}
#endif /* MBEDTLS_SSL_SESSION_TICKETS || ( MBEDTLS_SSL_NEW_SESSION_TICKET && MBEDTLS_SSL_SRV_C ) */
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 || MBEDTLS_SSL_PROTO_TLS1_1 || MBEDTLS_SSL_PROTO_TLS1 ||
MBEDTLS_SSL_NEW_SESSION_TICKET */

#if defined(MBEDTLS_SSL_USE_MPS)
int mbedtls_ssl_mps_remap_error( int ret )
Expand Down

0 comments on commit 62e6356

Please sign in to comment.