mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 10:55:38 +01:00
Add a few #ifdefs
This commit is contained in:
parent
ba958b8bdc
commit
8a7cf2543a
@ -1182,8 +1182,11 @@ read_record_header:
|
||||
buf = ssl->in_hdr;
|
||||
|
||||
#if defined(POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO)
|
||||
if( ssl->transport == SSL_TRANSPORT_STREAM && ( buf[0] & 0x80 ) != 0 )
|
||||
return ssl_parse_client_hello_v2( ssl );
|
||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||
if( ssl->transport == SSL_TRANSPORT_STREAM )
|
||||
#endif
|
||||
if( ( buf[0] & 0x80 ) != 0 )
|
||||
return ssl_parse_client_hello_v2( ssl );
|
||||
#endif
|
||||
|
||||
SSL_DEBUG_BUF( 4, "record header", buf, ssl_hdr_len( ssl ) );
|
||||
|
@ -5302,13 +5302,21 @@ const char *ssl_get_alpn_protocol( const ssl_context *ssl )
|
||||
static int ssl_check_version( const ssl_context *ssl, int major, int minor )
|
||||
{
|
||||
if( major < SSL_MIN_MAJOR_VERSION || major > SSL_MAX_MAJOR_VERSION ||
|
||||
minor < SSL_MIN_MINOR_VERSION || minor > SSL_MAX_MINOR_VERSION ||
|
||||
( ssl->transport == SSL_TRANSPORT_DATAGRAM &&
|
||||
minor < SSL_MINOR_VERSION_2 ) )
|
||||
minor < SSL_MIN_MINOR_VERSION || minor > SSL_MAX_MINOR_VERSION )
|
||||
{
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||
if( ssl->transport == SSL_TRANSPORT_DATAGRAM &&
|
||||
minor < SSL_MINOR_VERSION_2 )
|
||||
{
|
||||
return( -1 );
|
||||
}
|
||||
#else
|
||||
((void) ssl);
|
||||
#endif
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@ -5788,8 +5796,8 @@ int ssl_read( ssl_context *ssl, unsigned char *buf, size_t len )
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||
/* DTLS clients need to know renego is server-initiated */
|
||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||
if( ssl->transport == SSL_TRANSPORT_DATAGRAM &&
|
||||
ssl->endpoint == SSL_IS_CLIENT )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user