aboutsummaryrefslogtreecommitdiff
path: root/src/lib/tls
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2020-07-08 00:36:48 +0000
committerAlexander Færøy <ahf@torproject.org>2020-07-08 00:36:48 +0000
commite4bfa734a60555a1871a008c2a125fe55d564aa1 (patch)
treeb8e957d3328612307d4109b8ece888d30fd30b8d /src/lib/tls
parent9e33391ebb01700d3f3f9cb29a6b74756559de4a (diff)
parent9603d8af0b36dc8faf297c2a300becebfc2f721b (diff)
downloadtor-e4bfa734a60555a1871a008c2a125fe55d564aa1.tar.gz
tor-e4bfa734a60555a1871a008c2a125fe55d564aa1.zip
Merge branch 'maint-0.4.4'
Diffstat (limited to 'src/lib/tls')
-rw-r--r--src/lib/tls/x509.c3
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