summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/d1_lib.c11
-rw-r--r--src/lib/libssl/src/ssl/d1_lib.c11
2 files changed, 4 insertions, 18 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c
index 1dc0efc29c..b6b765634d 100644
--- a/src/lib/libssl/d1_lib.c
+++ b/src/lib/libssl/d1_lib.c
@@ -66,7 +66,6 @@
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include "ssl_locl.h" 67#include "ssl_locl.h"
68 68
69static void get_current_time(struct timeval *t);
70const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; 69const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT;
71int dtls1_listen(SSL *s, struct sockaddr *client); 70int dtls1_listen(SSL *s, struct sockaddr *client);
72 71
@@ -307,7 +306,7 @@ dtls1_start_timer(SSL *s)
307 } 306 }
308 307
309 /* Set timeout to current time */ 308 /* Set timeout to current time */
310 get_current_time(&(s->d1->next_timeout)); 309 gettimeofday(&(s->d1->next_timeout), NULL);
311 310
312 /* Add duration to current time */ 311 /* Add duration to current time */
313 s->d1->next_timeout.tv_sec += s->d1->timeout_duration; 312 s->d1->next_timeout.tv_sec += s->d1->timeout_duration;
@@ -324,7 +323,7 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) {
324 } 323 }
325 324
326 /* Get current time */ 325 /* Get current time */
327 get_current_time(&timenow); 326 gettimeofday(&timenow, NULL);
328 327
329 /* If timer already expired, set remaining time to 0 */ 328 /* If timer already expired, set remaining time to 0 */
330 if (s->d1->next_timeout.tv_sec < timenow.tv_sec || 329 if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
@@ -437,12 +436,6 @@ dtls1_handle_timeout(SSL *s)
437 return dtls1_retransmit_buffered_messages(s); 436 return dtls1_retransmit_buffered_messages(s);
438} 437}
439 438
440static void
441get_current_time(struct timeval *t)
442{
443 gettimeofday(t, NULL);
444}
445
446int 439int
447dtls1_listen(SSL *s, struct sockaddr *client) 440dtls1_listen(SSL *s, struct sockaddr *client)
448{ 441{
diff --git a/src/lib/libssl/src/ssl/d1_lib.c b/src/lib/libssl/src/ssl/d1_lib.c
index 1dc0efc29c..b6b765634d 100644
--- a/src/lib/libssl/src/ssl/d1_lib.c
+++ b/src/lib/libssl/src/ssl/d1_lib.c
@@ -66,7 +66,6 @@
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include "ssl_locl.h" 67#include "ssl_locl.h"
68 68
69static void get_current_time(struct timeval *t);
70const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; 69const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT;
71int dtls1_listen(SSL *s, struct sockaddr *client); 70int dtls1_listen(SSL *s, struct sockaddr *client);
72 71
@@ -307,7 +306,7 @@ dtls1_start_timer(SSL *s)
307 } 306 }
308 307
309 /* Set timeout to current time */ 308 /* Set timeout to current time */
310 get_current_time(&(s->d1->next_timeout)); 309 gettimeofday(&(s->d1->next_timeout), NULL);
311 310
312 /* Add duration to current time */ 311 /* Add duration to current time */
313 s->d1->next_timeout.tv_sec += s->d1->timeout_duration; 312 s->d1->next_timeout.tv_sec += s->d1->timeout_duration;
@@ -324,7 +323,7 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) {
324 } 323 }
325 324
326 /* Get current time */ 325 /* Get current time */
327 get_current_time(&timenow); 326 gettimeofday(&timenow, NULL);
328 327
329 /* If timer already expired, set remaining time to 0 */ 328 /* If timer already expired, set remaining time to 0 */
330 if (s->d1->next_timeout.tv_sec < timenow.tv_sec || 329 if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
@@ -437,12 +436,6 @@ dtls1_handle_timeout(SSL *s)
437 return dtls1_retransmit_buffered_messages(s); 436 return dtls1_retransmit_buffered_messages(s);
438} 437}
439 438
440static void
441get_current_time(struct timeval *t)
442{
443 gettimeofday(t, NULL);
444}
445
446int 439int
447dtls1_listen(SSL *s, struct sockaddr *client) 440dtls1_listen(SSL *s, struct sockaddr *client)
448{ 441{