summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-01-25 15:28:58 +0100
committerNick Mathewson <nickm@torproject.org>2011-01-25 14:13:06 -0500
commit68f8ca357fa98e7a2ed4ab45e4b982ea2ca370c8 (patch)
treebf5528a267b25a3514756dde0aaa66f06aede740 /src/or/config.c
parent5ed73e3807d90dd0a3a2e5542f98a0a58374a066 (diff)
downloadtor-68f8ca357fa98e7a2ed4ab45e4b982ea2ca370c8.tar.gz
tor-68f8ca357fa98e7a2ed4ab45e4b982ea2ca370c8.zip
Fix assert for relay/bridge state change
When we added support for separate client tls certs on bridges in a2bb0bfdd5 we forgot to correctly initialize this when changing from relay to bridge or vice versa while Tor is running. Fix that by always initializing keys when the state changes. Fixes bug 2433.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/config.c b/src/or/config.c
index b124db1899..8c1205de47 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1250,7 +1250,6 @@ options_act(or_options_t *old_options)
/* Check for transitions that need action. */
if (old_options) {
-
if ((options->UseEntryGuards && !old_options->UseEntryGuards) ||
(options->ExcludeNodes &&
!routerset_equal(old_options->ExcludeNodes,options->ExcludeNodes)) ||
@@ -1298,11 +1297,12 @@ options_act(or_options_t *old_options)
if (options_transition_affects_workers(old_options, options)) {
log_info(LD_GENERAL,
"Worker-related options changed. Rotating workers.");
+
+ if (init_keys() < 0) {
+ log_warn(LD_BUG,"Error initializing keys; exiting");
+ return -1;
+ }
if (server_mode(options) && !server_mode(old_options)) {
- if (init_keys() < 0) {
- log_warn(LD_BUG,"Error initializing keys; exiting");
- return -1;
- }
ip_address_changed(0);
if (can_complete_circuit || !any_predicted_circuits(time(NULL)))
inform_testing_reachability();
@@ -3810,6 +3810,7 @@ options_transition_affects_workers(or_options_t *old_options,
new_options->ServerDNSSearchDomains ||
old_options->SafeLogging != new_options->SafeLogging ||
old_options->ClientOnly != new_options->ClientOnly ||
+ public_server_mode(old_options) != public_server_mode(new_options) ||
!config_lines_eq(old_options->Logs, new_options->Logs))
return 1;