aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-08-18 11:36:19 -0400
committerNick Mathewson <nickm@torproject.org>2015-08-19 13:37:21 -0400
commit037e8763a7cb6358b4622ebef30bda6e11bb2ce5 (patch)
tree70a7bf9bf0a940daab31c0d1cfe996bcac4acb24 /src/or/main.c
parent428bb2d1c8bf5f10f7f76b9861b9a3ce498e07a7 (diff)
downloadtor-037e8763a7cb6358b4622ebef30bda6e11bb2ce5.tar.gz
tor-037e8763a7cb6358b4622ebef30bda6e11bb2ce5.zip
Reload Ed25519 keys on sighup.
Closes ticket 16790.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 0b0207b975..69718107df 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2019,6 +2019,14 @@ do_hup(void)
* force a retry there. */
if (server_mode(options)) {
+ /* 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)) {
+ log_warn(LD_OR, "Problem reloading Ed25519 keys; still using old keys.");
+ }
+
/* Update cpuworker and dnsworker processes, so they get up-to-date
* configuration options. */
cpuworkers_rotate_keyinfo();