mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 13:58:13 +00:00
Add SSL "assertion" to help static analysis
This commit is contained in:
parent
1cf7b30dc8
commit
dba460f2f3
2 changed files with 2 additions and 4 deletions
|
@ -2919,7 +2919,7 @@ int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if( ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER )
|
||||
if( ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER || ssl->handshake == NULL )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
|
||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "client state: %d", ssl->state ) );
|
||||
|
@ -2929,7 +2929,6 @@ int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
|
|||
|
||||
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM &&
|
||||
ssl->handshake != NULL &&
|
||||
ssl->handshake->retransmit_state == MBEDTLS_SSL_RETRANS_SENDING )
|
||||
{
|
||||
if( ( ret = mbedtls_ssl_resend( ssl ) ) != 0 )
|
||||
|
|
|
@ -3580,7 +3580,7 @@ int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl )
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if( ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER )
|
||||
if( ssl->state == MBEDTLS_SSL_HANDSHAKE_OVER || ssl->handshake == NULL )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
|
||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "server state: %d", ssl->state ) );
|
||||
|
@ -3590,7 +3590,6 @@ int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl )
|
|||
|
||||
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||
if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM &&
|
||||
ssl->handshake != NULL &&
|
||||
ssl->handshake->retransmit_state == MBEDTLS_SSL_RETRANS_SENDING )
|
||||
{
|
||||
if( ( ret = mbedtls_ssl_resend( ssl ) ) != 0 )
|
||||
|
|
Loading…
Reference in a new issue