aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-04-23 09:10:35 -0400
committerNick Mathewson <nickm@torproject.org>2015-04-23 09:10:35 -0400
commit647b7d37c2b3de4a837d0a4bf810c0132624c15d (patch)
treed2619889049cdd30f62ddebffb96cf62835cb6e5 /src/or/router.c
parent3acee6142221839137607c9a9cbf8ca4feea5993 (diff)
parente48ad353a31f3ee376f7914563d960916ad6aecd (diff)
downloadtor-647b7d37c2b3de4a837d0a4bf810c0132624c15d.tar.gz
tor-647b7d37c2b3de4a837d0a4bf810c0132624c15d.zip
Merge remote-tracking branch 'public/bug15745_027_03'
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 253f251cb5..24b7c750f6 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -683,7 +683,9 @@ router_initialize_tls_context(void)
if (!lifetime) { /* we should guess a good ssl cert lifetime */
/* choose between 5 and 365 days, and round to the day */
- lifetime = 5*24*3600 + crypto_rand_int(361*24*3600);
+ unsigned int five_days = 5*24*3600;
+ unsigned int one_year = 365*24*3600;
+ lifetime = crypto_rand_int_range(five_days, one_year);
lifetime -= lifetime % (24*3600);
if (crypto_rand_int(2)) {