]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix assert for relay/bridge state change
authorSebastian Hahn <sebastian@torproject.org>
Tue, 25 Jan 2011 14:28:58 +0000 (15:28 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 26 Oct 2011 20:09:44 +0000 (22:09 +0200)
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.

Conflicts:

src/or/config.c

changes/bug2433 [new file with mode: 0644]
src/or/config.c

diff --git a/changes/bug2433 b/changes/bug2433
new file mode 100644 (file)
index 0000000..8e47c4f
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes:
+    - Don't assert when changing from bridge to relay or vice versa with a controller.
+      The assert happened because we didn't properly initialize our keys in this case.
+      Bugfix on 0.2.2.18, fixes bug 2433. Issue first discovered by bastik.
+
index fbfa771ed3cbdb13c14d1abbfb8309ad31bcb132..7d7f2c38d80e795127678064468170f7298d7b6f 100644 (file)
@@ -1371,11 +1371,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 (has_completed_circuit || !any_predicted_circuits(time(NULL)))
           inform_testing_reachability();
@@ -3763,6 +3764,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;