[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Do not try to double-aquire lock when rotating keys. May f...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] Do not try to double-aquire lock when rotating keys. May f...
- From: nickm@xxxxxxxx (Nick Mathewson)
- Date: Fri, 11 Feb 2005 02:56:12 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Fri, 11 Feb 2005 02:56:44 -0500
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv13514/src/or
Modified Files:
router.c
Log Message:
Do not try to double-aquire lock when rotating keys. May fix deadlock bug found by weasel.
Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- router.c 11 Feb 2005 01:26:47 -0000 1.145
+++ router.c 11 Feb 2005 07:56:10 -0000 1.146
@@ -129,13 +129,15 @@
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.");