diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-06-05 15:52:06 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-06-05 15:52:06 -0400 |
commit | e3b1573be6aefc91946fa4649591ed1690d77ee8 (patch) | |
tree | 449e6a0f317b7ce73a18b3c34477f474247f074f /src/or/main.c | |
parent | dd573f72b2f20b9aec310ee298ac4e9b737f835d (diff) | |
parent | 91f49bc0f0759d0e0a794fbfe8cce5a9bb07e607 (diff) | |
download | tor-e3b1573be6aefc91946fa4649591ed1690d77ee8.tar.gz tor-e3b1573be6aefc91946fa4649591ed1690d77ee8.zip |
Merge branch 'maint-0.3.0'
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c index 2520a7e21d..9699c8d381 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1551,8 +1551,9 @@ check_ed_keys_callback(time_t now, const or_options_t *options) { if (server_mode(options)) { if (should_make_new_ed_keys(options, now)) { - if (load_ed_keys(options, now) < 0 || - generate_ed_link_cert(options, now)) { + int new_signing_key = load_ed_keys(options, now); + if (new_signing_key < 0 || + generate_ed_link_cert(options, now, new_signing_key > 0)) { log_err(LD_OR, "Unable to update Ed25519 keys! Exiting."); tor_cleanup(); exit(0); @@ -1604,6 +1605,11 @@ rotate_x509_certificate_callback(time_t now, const or_options_t *options) log_err(LD_BUG, "Error reinitializing TLS context"); tor_assert_unreached(); } + if (generate_ed_link_cert(options, now, 1)) { + log_err(LD_OR, "Unable to update Ed25519->TLS link certificate for " + "new TLS context."); + tor_assert_unreached(); + } /* We also make sure to rotate the TLS connections themselves if they've * been up for too long -- but that's done via is_bad_for_new_circs in @@ -2376,8 +2382,9 @@ do_hup(void) /* Maybe we've been given a new ed25519 key or certificate? */ time_t now = approx_time(); - if (load_ed_keys(options, now) < 0 || - generate_ed_link_cert(options, now)) { + int new_signing_key = load_ed_keys(options, now); + if (new_signing_key < 0 || + generate_ed_link_cert(options, now, new_signing_key > 0)) { log_warn(LD_OR, "Problem reloading Ed25519 keys; still using old keys."); } @@ -3745,7 +3752,7 @@ tor_main(int argc, char *argv[]) result = do_main_loop(); break; case CMD_KEYGEN: - result = load_ed_keys(get_options(), time(NULL)); + result = load_ed_keys(get_options(), time(NULL)) < 0; break; case CMD_LIST_FINGERPRINT: result = do_list_fingerprint(); |