File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -3201,8 +3201,10 @@ int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl )
3201
3201
}
3202
3202
}
3203
3203
3204
- if ( ssl -> out_msgtype == MBEDTLS_SSL_MSG_HANDSHAKE &&
3205
- hs_type != MBEDTLS_SSL_HS_HELLO_REQUEST &&
3204
+ /* Whenever we send anything different from a
3205
+ * HelloRequest we should be in a handshake - double check. */
3206
+ if ( ! ( ssl -> out_msgtype == MBEDTLS_SSL_MSG_HANDSHAKE &&
3207
+ hs_type == MBEDTLS_SSL_HS_HELLO_REQUEST ) &&
3206
3208
ssl -> handshake == NULL )
3207
3209
{
3208
3210
MBEDTLS_SSL_DEBUG_MSG ( 1 , ( "should never happen" ) );
@@ -3296,8 +3298,8 @@ int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl )
3296
3298
/* Either send now, or just save to be sent (and resent) later */
3297
3299
#if defined(MBEDTLS_SSL_PROTO_DTLS )
3298
3300
if ( ssl -> conf -> transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM &&
3299
- ( ssl -> out_msgtype != MBEDTLS_SSL_MSG_HANDSHAKE ||
3300
- hs_type ! = MBEDTLS_SSL_HS_HELLO_REQUEST ) )
3301
+ ! ( ssl -> out_msgtype == MBEDTLS_SSL_MSG_HANDSHAKE &&
3302
+ hs_type = = MBEDTLS_SSL_HS_HELLO_REQUEST ) )
3301
3303
{
3302
3304
if ( ( ret = ssl_flight_append ( ssl ) ) != 0 )
3303
3305
{
You can’t perform that action at this time.
0 commit comments