Skip to content

Commit

Permalink
Only call dtls1_start_timer() once
Browse files Browse the repository at this point in the history
The function dtls1_handle_timeout() calls dtls1_double_timeout() which
was calling dtls1_start_timer(). However dtls1_start_timer() is also
called directly by dtls1_handle_timeout(). We only need to start the timer
once.

Fixes openssl#15561

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from openssl#15595)
  • Loading branch information
mattcaswell authored and paulidale committed Jun 4, 2021
1 parent d0196dd commit f570d33
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions ssl/d1_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,11 @@ int dtls1_is_timer_expired(SSL *s)
return 1;
}

void dtls1_double_timeout(SSL *s)
static void dtls1_double_timeout(SSL *s)
{
s->d1->timeout_duration_us *= 2;
if (s->d1->timeout_duration_us > 60000000)
s->d1->timeout_duration_us = 60000000;
dtls1_start_timer(s);
}

void dtls1_stop_timer(SSL *s)
Expand Down
1 change: 0 additions & 1 deletion ssl/ssl_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,6 @@ __owur int dtls1_handle_timeout(SSL *s);
void dtls1_start_timer(SSL *s);
void dtls1_stop_timer(SSL *s);
__owur int dtls1_is_timer_expired(SSL *s);
void dtls1_double_timeout(SSL *s);
__owur int dtls_raw_hello_verify_request(WPACKET *pkt, unsigned char *cookie,
size_t cookie_len);
__owur size_t dtls1_min_mtu(SSL *s);
Expand Down

0 comments on commit f570d33

Please sign in to comment.