diff options
| author | deraadt <> | 2015-09-29 18:08:57 +0000 |
|---|---|---|
| committer | deraadt <> | 2015-09-29 18:08:57 +0000 |
| commit | 389b88a362fe448a1c3e801ddf7cda4da9f93181 (patch) | |
| tree | 48155c2de8c7bb73a988efd48104fc9dba41660c /src/lib/libssl/bio_ssl.c | |
| parent | 7ee31307a09e454f1d18f1904dbae11610fd0b50 (diff) | |
| download | openbsd-389b88a362fe448a1c3e801ddf7cda4da9f93181.tar.gz openbsd-389b88a362fe448a1c3e801ddf7cda4da9f93181.tar.bz2 openbsd-389b88a362fe448a1c3e801ddf7cda4da9f93181.zip | |
convert "last_time" to a time_t, to handle beyond Y2038
ok guenther miod
Diffstat (limited to 'src/lib/libssl/bio_ssl.c')
| -rw-r--r-- | src/lib/libssl/bio_ssl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libssl/bio_ssl.c b/src/lib/libssl/bio_ssl.c index cfaf78a4dd..6ddbb008e6 100644 --- a/src/lib/libssl/bio_ssl.c +++ b/src/lib/libssl/bio_ssl.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bio_ssl.c,v 1.21 2014/11/16 14:12:47 jsing Exp $ */ | 1 | /* $OpenBSD: bio_ssl.c,v 1.22 2015/09/29 18:08:57 deraadt Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -80,7 +80,7 @@ typedef struct bio_ssl_st { | |||
| 80 | unsigned long renegotiate_count; | 80 | unsigned long renegotiate_count; |
| 81 | unsigned long byte_count; | 81 | unsigned long byte_count; |
| 82 | unsigned long renegotiate_timeout; | 82 | unsigned long renegotiate_timeout; |
| 83 | unsigned long last_time; | 83 | time_t last_time; |
| 84 | } BIO_SSL; | 84 | } BIO_SSL; |
| 85 | 85 | ||
| 86 | static BIO_METHOD methods_sslp = { | 86 | static BIO_METHOD methods_sslp = { |
| @@ -169,9 +169,9 @@ ssl_read(BIO *b, char *out, int outl) | |||
| 169 | } | 169 | } |
| 170 | } | 170 | } |
| 171 | if ((sb->renegotiate_timeout > 0) && (!r)) { | 171 | if ((sb->renegotiate_timeout > 0) && (!r)) { |
| 172 | unsigned long tm; | 172 | time_t tm; |
| 173 | 173 | ||
| 174 | tm = (unsigned long)time(NULL); | 174 | tm = time(NULL); |
| 175 | if (tm > sb->last_time + sb->renegotiate_timeout) { | 175 | if (tm > sb->last_time + sb->renegotiate_timeout) { |
| 176 | sb->last_time = tm; | 176 | sb->last_time = tm; |
| 177 | sb->num_renegotiates++; | 177 | sb->num_renegotiates++; |
| @@ -242,9 +242,9 @@ ssl_write(BIO *b, const char *out, int outl) | |||
| 242 | } | 242 | } |
| 243 | } | 243 | } |
| 244 | if ((bs->renegotiate_timeout > 0) && (!r)) { | 244 | if ((bs->renegotiate_timeout > 0) && (!r)) { |
| 245 | unsigned long tm; | 245 | time_t tm; |
| 246 | 246 | ||
| 247 | tm = (unsigned long)time(NULL); | 247 | tm = time(NULL); |
| 248 | if (tm > bs->last_time + bs->renegotiate_timeout) { | 248 | if (tm > bs->last_time + bs->renegotiate_timeout) { |
| 249 | bs->last_time = tm; | 249 | bs->last_time = tm; |
| 250 | bs->num_renegotiates++; | 250 | bs->num_renegotiates++; |
| @@ -319,7 +319,7 @@ ssl_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 319 | if (num < 60) | 319 | if (num < 60) |
| 320 | num = 5; | 320 | num = 5; |
| 321 | bs->renegotiate_timeout = (unsigned long)num; | 321 | bs->renegotiate_timeout = (unsigned long)num; |
| 322 | bs->last_time = (unsigned long)time(NULL); | 322 | bs->last_time = time(NULL); |
| 323 | break; | 323 | break; |
| 324 | case BIO_C_SET_SSL_RENEGOTIATE_BYTES: | 324 | case BIO_C_SET_SSL_RENEGOTIATE_BYTES: |
| 325 | ret = bs->renegotiate_count; | 325 | ret = bs->renegotiate_count; |
