diff options
author | Alexander Færøy <ahf@torproject.org> | 2020-07-08 00:36:48 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2020-07-08 00:36:48 +0000 |
commit | c364e0e83bd98bf66b68cdacff28ad6c5924abf5 (patch) | |
tree | b2738f33be58816fb8fa782807ece1dbe035b5d6 /src/lib/tls/x509.c | |
parent | a213d2793860240b315f372159311f307aed68ca (diff) | |
parent | b81e24cda687e9633c18b741ed92ce6bafb77643 (diff) | |
download | tor-c364e0e83bd98bf66b68cdacff28ad6c5924abf5.tar.gz tor-c364e0e83bd98bf66b68cdacff28ad6c5924abf5.zip |
Merge branch 'maint-0.4.2' into maint-0.4.3
Diffstat (limited to 'src/lib/tls/x509.c')
-rw-r--r-- | src/lib/tls/x509.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/tls/x509.c b/src/lib/tls/x509.c index 793fa8b9c3..2515499298 100644 --- a/src/lib/tls/x509.c +++ b/src/lib/tls/x509.c @@ -23,6 +23,7 @@ tor_tls_pick_certificate_lifetime(time_t now, time_t *start_time_out, time_t *end_time_out) { + tor_assert(cert_lifetime < INT_MAX); time_t start_time, end_time; /* Make sure we're part-way through the certificate lifetime, rather * than having it start right now. Don't choose quite uniformly, since @@ -36,7 +37,7 @@ tor_tls_pick_certificate_lifetime(time_t now, const time_t start_granularity = 24*3600; time_t earliest_start_time; /* Don't actually start in the future! */ - if (cert_lifetime <= min_real_lifetime + start_granularity) { + if ((int)cert_lifetime <= min_real_lifetime + start_granularity) { earliest_start_time = now - 1; } else { earliest_start_time = now + min_real_lifetime + start_granularity |