summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>2015-09-29 18:08:57 +0000
committerderaadt <>2015-09-29 18:08:57 +0000
commitc649d811f1ee784aef5143f06fd038b66b6caf01 (patch)
tree48155c2de8c7bb73a988efd48104fc9dba41660c /src/lib
parent85e1dd6e42a412bf15e88ce481b4efbef96053c7 (diff)
downloadopenbsd-c649d811f1ee784aef5143f06fd038b66b6caf01.tar.gz
openbsd-c649d811f1ee784aef5143f06fd038b66b6caf01.tar.bz2
openbsd-c649d811f1ee784aef5143f06fd038b66b6caf01.zip
convert "last_time" to a time_t, to handle beyond Y2038
ok guenther miod
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/bio_ssl.c14
-rw-r--r--src/lib/libssl/src/ssl/bio_ssl.c14
2 files changed, 14 insertions, 14 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
86static BIO_METHOD methods_sslp = { 86static 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;
diff --git a/src/lib/libssl/src/ssl/bio_ssl.c b/src/lib/libssl/src/ssl/bio_ssl.c
index cfaf78a4dd..6ddbb008e6 100644
--- a/src/lib/libssl/src/ssl/bio_ssl.c
+++ b/src/lib/libssl/src/ssl/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
86static BIO_METHOD methods_sslp = { 86static 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;