aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-03-01 14:36:40 +0100
committerNick Mathewson <nickm@torproject.org>2015-05-28 10:42:30 -0400
commit57189acd6f6b56a419d63a7acb012a9b8abac319 (patch)
treecae61ade268b8e599ca4299a73b403203f15a584 /src/or/main.c
parent64450c5f775c6453568c5ac218669ff0525dc232 (diff)
downloadtor-57189acd6f6b56a419d63a7acb012a9b8abac319.tar.gz
tor-57189acd6f6b56a419d63a7acb012a9b8abac319.zip
# This is a combination of 2 commits.
# The first commit's message is: Regenerate ed25519 keys when they will expire soon. Also, have testing-level options to set the lifetimes and expiration-tolerances of all key types, plus a non-testing-level option to set the lifetime of any auto-generated signing key. # The 2nd commit message will be skipped: # fixup! Regenerate ed25519 keys when they will expire soon.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 70d075f432..c4b5af4ab4 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -134,6 +134,8 @@ time_t time_of_process_start = 0;
long stats_n_seconds_working = 0;
/** When do we next launch DNS wildcarding checks? */
static time_t time_to_check_for_correct_dns = 0;
+/** When do we next make sure our Ed25519 keys aren't about to expire? */
+static time_t time_to_check_ed_keys = 0;
/** How often will we honor SIGNEWNYM requests? */
#define MAX_SIGNEWNYM_RATE 10
@@ -1280,6 +1282,17 @@ run_scheduled_events(time_t now)
router_upload_dir_desc_to_dirservers(0);
}
+ if (is_server && time_to_check_ed_keys < now) {
+ if (should_make_new_ed_keys(options, now)) {
+ if (load_ed_keys(options, now) < 0) {
+ log_err(LD_OR, "Unable to update Ed25519 keys! Exiting.");
+ tor_cleanup();
+ exit(0);
+ }
+ }
+ time_to_check_ed_keys = now + 30;
+ }
+
if (!should_delay_dir_fetches(options, NULL) &&
time_to_try_getting_descriptors < now) {
update_all_descriptor_downloads(now);