Only call dtls1_start_timer() once
authorMatt Caswell <matt@openssl.org>
Wed, 2 Jun 2021 16:19:23 +0000 (17:19 +0100)
committerPauli <pauli@openssl.org>
Fri, 4 Jun 2021 01:07:13 +0000 (11:07 +1000)
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 #15561

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15595)

(cherry picked from commit f570d33b02d824e2a3f676f718c4692572f45333)

ssl/d1_lib.c
ssl/ssl_local.h

index afbf015216a39fb1fcbbf8d387bb2365b9d1e8c7..05b85c1078c052c8cd93517be9f438e586b79b38 100644 (file)
@@ -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)
index 8c3542a5422f9ff732b3c5fccc7940ab72cdf30f..a357d4d950549b1fb1c0cddbc66c0f87c415fa55 100644 (file)
@@ -2426,7 +2426,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);