mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Another attempt at fixing the STACK warning in tortls.c
Patch suggestion from catalyst. Related to 24423
This commit is contained in:
parent
15b41fa6ae
commit
f7e393eb4c
1 changed files with 6 additions and 3 deletions
|
@ -491,11 +491,14 @@ tor_tls_create_certificate,(crypto_pk_t *rsa,
|
||||||
* the past. */
|
* the past. */
|
||||||
const time_t min_real_lifetime = 24*3600;
|
const time_t min_real_lifetime = 24*3600;
|
||||||
const time_t start_granularity = 24*3600;
|
const time_t start_granularity = 24*3600;
|
||||||
time_t earliest_start_time = now - cert_lifetime + min_real_lifetime
|
time_t earliest_start_time;
|
||||||
+ start_granularity;
|
|
||||||
/* Don't actually start in the future! */
|
/* Don't actually start in the future! */
|
||||||
if (earliest_start_time >= now)
|
if (cert_lifetime <= min_real_lifetime + start_granularity) {
|
||||||
earliest_start_time = now - 1;
|
earliest_start_time = now - 1;
|
||||||
|
} else {
|
||||||
|
earliest_start_time = now + min_real_lifetime + start_granularity
|
||||||
|
- cert_lifetime;
|
||||||
|
}
|
||||||
start_time = crypto_rand_time_range(earliest_start_time, now);
|
start_time = crypto_rand_time_range(earliest_start_time, now);
|
||||||
/* Round the start time back to the start of a day. */
|
/* Round the start time back to the start of a day. */
|
||||||
start_time -= start_time % start_granularity;
|
start_time -= start_time % start_granularity;
|
||||||
|
|
Loading…
Add table
Reference in a new issue