Merge branch 'maint-0.4.4'

This commit is contained in:
Alexander Færøy 2020-07-08 00:36:48 +00:00
commit e4bfa734a6
2 changed files with 5 additions and 1 deletions

3
changes/bug40028 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes (compiler warnings):
- Fix a compiler warning on platforms with 32-bit time_t values.
Fixes bug 40028; bugfix on 0.3.2.8-rc.

View File

@ -23,6 +23,7 @@ tor_tls_pick_certificate_lifetime(time_t now,
time_t *start_time_out, time_t *start_time_out,
time_t *end_time_out) time_t *end_time_out)
{ {
tor_assert(cert_lifetime < INT_MAX);
time_t start_time, end_time; time_t start_time, end_time;
/* Make sure we're part-way through the certificate lifetime, rather /* Make sure we're part-way through the certificate lifetime, rather
* than having it start right now. Don't choose quite uniformly, since * 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; const time_t start_granularity = 24*3600;
time_t earliest_start_time; time_t earliest_start_time;
/* Don't actually start in the future! */ /* 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; earliest_start_time = now - 1;
} else { } else {
earliest_start_time = now + min_real_lifetime + start_granularity earliest_start_time = now + min_real_lifetime + start_granularity