mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Fix misplaced initialisation of timeout
This commit is contained in:
committed by
Paul Bakker
parent
37a4de2cec
commit
6c1fa3a184
@ -255,6 +255,8 @@
|
|||||||
*
|
*
|
||||||
* The SENDING state is merged in PREPARING for initial sends,
|
* The SENDING state is merged in PREPARING for initial sends,
|
||||||
* but is distinct for resends.
|
* but is distinct for resends.
|
||||||
|
*
|
||||||
|
* Note: initial state is wrong for server, but is not used anyway.
|
||||||
*/
|
*/
|
||||||
#define SSL_RETRANS_PREPARING 0
|
#define SSL_RETRANS_PREPARING 0
|
||||||
#define SSL_RETRANS_SENDING 1
|
#define SSL_RETRANS_SENDING 1
|
||||||
|
@ -2307,9 +2307,8 @@ void ssl_recv_flight_completed( ssl_context *ssl )
|
|||||||
/* The next incoming flight will start with this msg_seq */
|
/* The next incoming flight will start with this msg_seq */
|
||||||
ssl->handshake->in_flight_start_seq = ssl->handshake->in_msg_seq;
|
ssl->handshake->in_flight_start_seq = ssl->handshake->in_msg_seq;
|
||||||
|
|
||||||
/* Cancel timer and reset timeout value */
|
/* Cancel timer */
|
||||||
ssl_set_timer( ssl, 0 );
|
ssl_set_timer( ssl, 0 );
|
||||||
ssl_reset_retransmit_timeout( ssl );
|
|
||||||
|
|
||||||
if( ssl->in_msgtype == SSL_MSG_HANDSHAKE &&
|
if( ssl->in_msgtype == SSL_MSG_HANDSHAKE &&
|
||||||
ssl->in_msg[0] == SSL_HS_FINISHED )
|
ssl->in_msg[0] == SSL_HS_FINISHED )
|
||||||
@ -2325,6 +2324,7 @@ void ssl_recv_flight_completed( ssl_context *ssl )
|
|||||||
*/
|
*/
|
||||||
void ssl_send_flight_completed( ssl_context *ssl )
|
void ssl_send_flight_completed( ssl_context *ssl )
|
||||||
{
|
{
|
||||||
|
ssl_reset_retransmit_timeout( ssl );
|
||||||
ssl_set_timer( ssl, ssl->handshake->retransmit_timeout );
|
ssl_set_timer( ssl, ssl->handshake->retransmit_timeout );
|
||||||
|
|
||||||
if( ssl->in_msgtype == SSL_MSG_HANDSHAKE &&
|
if( ssl->in_msgtype == SSL_MSG_HANDSHAKE &&
|
||||||
@ -4535,8 +4535,7 @@ static int ssl_handshake_init( ssl_context *ssl )
|
|||||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||||
ssl->handshake->alt_transform_out = ssl->transform_out;
|
ssl->handshake->alt_transform_out = ssl->transform_out;
|
||||||
|
|
||||||
ssl->handshake->retransmit_timeout = ssl->hs_timeout_min;
|
// TODO: not the right place, we may not know endpoint yet
|
||||||
|
|
||||||
if( ssl->endpoint == SSL_IS_CLIENT )
|
if( ssl->endpoint == SSL_IS_CLIENT )
|
||||||
ssl->handshake->retransmit_state = SSL_RETRANS_PREPARING;
|
ssl->handshake->retransmit_state = SSL_RETRANS_PREPARING;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user