diff options
| author | deraadt <> | 2014-04-20 14:14:52 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-04-20 14:14:52 +0000 |
| commit | fdfc9baf76e354d25c9fc526da1cba8d9ed1fa6d (patch) | |
| tree | fadcbe89e70fef464f6d959c3aad030af56bbeb1 /src | |
| parent | de12e86671704471d5c3e86111054c59d9efb9b1 (diff) | |
| download | openbsd-fdfc9baf76e354d25c9fc526da1cba8d9ed1fa6d.tar.gz openbsd-fdfc9baf76e354d25c9fc526da1cba8d9ed1fa6d.tar.bz2 openbsd-fdfc9baf76e354d25c9fc526da1cba8d9ed1fa6d.zip | |
gettimeofday() is portable enough and does not need a wrapper
Diffstat (limited to 'src')
| -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 | { |
