Selaa lähdekoodia

Merge remote-tracking branch 'origin/maint-0.2.2'

Nick Mathewson 12 vuotta sitten
vanhempi
commit
0cbe3ff313
2 muutettua tiedostoa jossa 13 lisäystä ja 1 poistoa
  1. 6 0
      changes/bug5283
  2. 7 1
      src/or/circuituse.c

+ 6 - 0
changes/bug5283

@@ -0,0 +1,6 @@
+  o Major bugfixes:
+    - Fix an edge case where if we fetch or publish a hidden service
+      descriptor, we might build a 4-hop circuit and then use that circuit
+      for exiting afterwards -- even if the new last hop doesn't obey our
+      ExitNodes config option. Fixes bug 5283; bugfix on 0.2.0.10-alpha.
+

+ 7 - 1
src/or/circuituse.c

@@ -1412,7 +1412,13 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
   need_uptime = !conn->want_onehop && !conn->use_begindir &&
                 smartlist_string_num_isin(options->LongLivedPorts,
                                           conn->socks_request->port);
-  need_internal = desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL;
+
+  if (desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)
+    need_internal = 1;
+  else if (conn->use_begindir || conn->want_onehop)
+    need_internal = 1;
+  else
+    need_internal = 0;
 
   circ = circuit_get_best(conn, 1, desired_circuit_purpose,
                           need_uptime, need_internal);