summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-02-11 07:56:10 +0000
committerNick Mathewson <nickm@torproject.org>2005-02-11 07:56:10 +0000
commit58540dde50566651dc884f58cef4262eb7ac0bd8 (patch)
tree44c3fd4c89b980d08a9df6598581fca57f72009a /src
parent5d836c81408142519d3d5791b95c908c5240b3b7 (diff)
downloadtor-58540dde50566651dc884f58cef4262eb7ac0bd8.tar.gz
tor-58540dde50566651dc884f58cef4262eb7ac0bd8.zip
Do not try to double-aquire lock when rotating keys. May fix deadlock bug found by weasel.
svn:r3616
Diffstat (limited to 'src')
-rw-r--r--src/or/router.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 4d63b914d2..0cb45def30 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -129,13 +129,15 @@ void rotate_onion_key(void)
log(LOG_ERR, "Couldn't write generated key to %s.", fname);
goto error;
}
+ log_fn(LOG_INFO, "Rotating onion key");
tor_mutex_acquire(key_lock);
if (lastonionkey)
crypto_free_pk_env(lastonionkey);
- log_fn(LOG_INFO, "Rotating onion key");
lastonionkey = onionkey;
- set_onion_key(prkey);
+ onionkey = prkey;
+ onionkey_set_at = time(NULL);
tor_mutex_release(key_lock);
+ mark_my_descriptor_dirty();
return;
error:
log_fn(LOG_WARN, "Couldn't rotate onion key.");