mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-05-04 04:06:25 +00:00
Fixes for the renego-option merge
This commit is contained in:
parent
0af1ba3521
commit
b89c4f35a1
|
@ -1345,7 +1345,12 @@ read_record_header:
|
||||||
msg_len = ( ssl->in_len[0] << 8 ) | ssl->in_len[1];
|
msg_len = ( ssl->in_len[0] << 8 ) | ssl->in_len[1];
|
||||||
|
|
||||||
#if defined(POLARSSL_SSL_RENEGOTIATION)
|
#if defined(POLARSSL_SSL_RENEGOTIATION)
|
||||||
if( ssl->renegotiation == SSL_INITIAL_HANDSHAKE )
|
if( ssl->renegotiation != SSL_INITIAL_HANDSHAKE )
|
||||||
|
{
|
||||||
|
/* Set by ssl_read_record() */
|
||||||
|
msg_len = ssl->in_hslen;
|
||||||
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if( msg_len > SSL_MAX_CONTENT_LEN )
|
if( msg_len > SSL_MAX_CONTENT_LEN )
|
||||||
|
@ -1368,11 +1373,6 @@ read_record_header:
|
||||||
#endif
|
#endif
|
||||||
ssl->in_left = 0;
|
ssl->in_left = 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Set by ssl_read_record() */
|
|
||||||
msg_len = ssl->in_hslen;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = ssl->in_msg;
|
buf = ssl->in_msg;
|
||||||
|
|
||||||
|
|
|
@ -2079,7 +2079,7 @@ static int ssl_decompress_buf( ssl_context *ssl )
|
||||||
}
|
}
|
||||||
#endif /* POLARSSL_ZLIB_SUPPORT */
|
#endif /* POLARSSL_ZLIB_SUPPORT */
|
||||||
|
|
||||||
#if defined(POLARSSL_SSL_SRV_C)
|
#if defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_SSL_RENEGOTIATION)
|
||||||
static int ssl_write_hello_request( ssl_context *ssl );
|
static int ssl_write_hello_request( ssl_context *ssl );
|
||||||
|
|
||||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||||
|
@ -2108,7 +2108,7 @@ static int ssl_resend_hello_request( ssl_context *ssl )
|
||||||
return( ssl_write_hello_request( ssl ) );
|
return( ssl_write_hello_request( ssl ) );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif /* POLARSSL_SSL_SRV_C && POLARSSL_SSL_RENEGOTIATION */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill the input message buffer by appending data to it.
|
* Fill the input message buffer by appending data to it.
|
||||||
|
@ -2258,7 +2258,7 @@ int ssl_fetch_input( ssl_context *ssl, size_t nb_want )
|
||||||
|
|
||||||
return( POLARSSL_ERR_NET_WANT_READ );
|
return( POLARSSL_ERR_NET_WANT_READ );
|
||||||
}
|
}
|
||||||
#if defined(POLARSSL_SSL_SRV_C)
|
#if defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_SSL_RENEGOTIATION)
|
||||||
else if( ssl->endpoint == SSL_IS_SERVER &&
|
else if( ssl->endpoint == SSL_IS_SERVER &&
|
||||||
ssl->renegotiation == SSL_RENEGOTIATION_PENDING )
|
ssl->renegotiation == SSL_RENEGOTIATION_PENDING )
|
||||||
{
|
{
|
||||||
|
@ -2270,7 +2270,7 @@ int ssl_fetch_input( ssl_context *ssl, size_t nb_want )
|
||||||
|
|
||||||
return( POLARSSL_ERR_NET_WANT_READ );
|
return( POLARSSL_ERR_NET_WANT_READ );
|
||||||
}
|
}
|
||||||
#endif /* POLARSSL_SSL_SRV_C */
|
#endif /* POLARSSL_SSL_SRV_C && POLARSSL_SSL_RENEGOTIATION */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
|
@ -6274,7 +6274,7 @@ int ssl_read( ssl_context *ssl, unsigned char *buf, size_t len )
|
||||||
/* If we requested renego but received AppData, resend HelloRequest.
|
/* If we requested renego but received AppData, resend HelloRequest.
|
||||||
* Do it now, after setting in_offt, to avoid taking this branch
|
* Do it now, after setting in_offt, to avoid taking this branch
|
||||||
* again if ssl_write_hello_request() returns WANT_WRITE */
|
* again if ssl_write_hello_request() returns WANT_WRITE */
|
||||||
#if defined(POLARSSL_SSL_SRV_C)
|
#if defined(POLARSSL_SSL_SRV_C) && defined(POLARSSL_SSL_RENEGOTIATION)
|
||||||
if( ssl->endpoint == SSL_IS_SERVER &&
|
if( ssl->endpoint == SSL_IS_SERVER &&
|
||||||
ssl->renegotiation == SSL_RENEGOTIATION_PENDING )
|
ssl->renegotiation == SSL_RENEGOTIATION_PENDING )
|
||||||
{
|
{
|
||||||
|
@ -6284,7 +6284,7 @@ int ssl_read( ssl_context *ssl, unsigned char *buf, size_t len )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* POLARSSL_SSL_SRV_C */
|
#endif /* POLARSSL_SSL_SRV_C && POLARSSL_SSL_RENEGOTIATION */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue