diff options
author | deraadt <> | 2014-04-20 14:14:52 +0000 |
---|---|---|
committer | deraadt <> | 2014-04-20 14:14:52 +0000 |
commit | 5ebe999453f510fc76906c79d60f771b13af212b (patch) | |
tree | fadcbe89e70fef464f6d959c3aad030af56bbeb1 /src/lib | |
parent | a901539e7593dfd0cb8170bdfd94856651828ca2 (diff) | |
download | openbsd-5ebe999453f510fc76906c79d60f771b13af212b.tar.gz openbsd-5ebe999453f510fc76906c79d60f771b13af212b.tar.bz2 openbsd-5ebe999453f510fc76906c79d60f771b13af212b.zip |
gettimeofday() is portable enough and does not need a wrapper
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/d1_lib.c | 11 | ||||
-rw-r--r-- | src/lib/libssl/src/ssl/d1_lib.c | 11 |
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 | ||
69 | static void get_current_time(struct timeval *t); | ||
70 | const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; | 69 | const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; |
71 | int dtls1_listen(SSL *s, struct sockaddr *client); | 70 | int 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 | ||
440 | static void | ||
441 | get_current_time(struct timeval *t) | ||
442 | { | ||
443 | gettimeofday(t, NULL); | ||
444 | } | ||
445 | |||
446 | int | 439 | int |
447 | dtls1_listen(SSL *s, struct sockaddr *client) | 440 | dtls1_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 | ||
69 | static void get_current_time(struct timeval *t); | ||
70 | const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; | 69 | const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; |
71 | int dtls1_listen(SSL *s, struct sockaddr *client); | 70 | int 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 | ||
440 | static void | ||
441 | get_current_time(struct timeval *t) | ||
442 | { | ||
443 | gettimeofday(t, NULL); | ||
444 | } | ||
445 | |||
446 | int | 439 | int |
447 | dtls1_listen(SSL *s, struct sockaddr *client) | 440 | dtls1_listen(SSL *s, struct sockaddr *client) |
448 | { | 441 | { |