summaryrefslogtreecommitdiffstats
path: root/lib/libssl/d1_lib.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-04-20 14:14:52 +0000
committerderaadt <deraadt@openbsd.org>2014-04-20 14:14:52 +0000
commit33e311cf613bdb37bf3b717c434888c1e4487910 (patch)
treecbf77d14abeda121ef6847449c94489088e920ec /lib/libssl/d1_lib.c
parentcalloc() rather than malloc+memset (diff)
downloadwireguard-openbsd-33e311cf613bdb37bf3b717c434888c1e4487910.tar.xz
wireguard-openbsd-33e311cf613bdb37bf3b717c434888c1e4487910.zip
gettimeofday() is portable enough and does not need a wrapper
Diffstat (limited to 'lib/libssl/d1_lib.c')
-rw-r--r--lib/libssl/d1_lib.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c
index 1dc0efc29ca..b6b765634da 100644
--- a/lib/libssl/d1_lib.c
+++ b/lib/libssl/d1_lib.c
@@ -66,7 +66,6 @@
#include <openssl/objects.h>
#include "ssl_locl.h"
-static void get_current_time(struct timeval *t);
const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT;
int dtls1_listen(SSL *s, struct sockaddr *client);
@@ -307,7 +306,7 @@ dtls1_start_timer(SSL *s)
}
/* Set timeout to current time */
- get_current_time(&(s->d1->next_timeout));
+ gettimeofday(&(s->d1->next_timeout), NULL);
/* Add duration to current time */
s->d1->next_timeout.tv_sec += s->d1->timeout_duration;
@@ -324,7 +323,7 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) {
}
/* Get current time */
- get_current_time(&timenow);
+ gettimeofday(&timenow, NULL);
/* If timer already expired, set remaining time to 0 */
if (s->d1->next_timeout.tv_sec < timenow.tv_sec ||
@@ -437,12 +436,6 @@ dtls1_handle_timeout(SSL *s)
return dtls1_retransmit_buffered_messages(s);
}
-static void
-get_current_time(struct timeval *t)
-{
- gettimeofday(t, NULL);
-}
-
int
dtls1_listen(SSL *s, struct sockaddr *client)
{