From 834654f145cc1205e20cf5f07a37bef2e11252ce Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 15 May 2012 09:41:45 -0400 Subject: [PATCH 1/2] Make all begindir or one-hop circuits internal This solves bug 5283, where client traffic could get sent over the same circuit as an anonymized connection to a directory, even if that circuit used an exit node unsuitable for clients. By marking the directory connection as needs_internal, we ensure that the (non-internal!) client-traffic connection won't be sent over the same circuit. --- src/or/circuituse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 0ad8b3b51b..df33f63bb9 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -1229,7 +1229,13 @@ circuit_get_open_circ_or_launch(edge_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); From b7e863c07305941d0c12b46da503fca694148abf Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 15 May 2012 20:50:29 -0400 Subject: [PATCH 2/2] add changes file for bug 5283 I called it a bugfix on 0.2.0.10-alpha, since git commit e5885deab is where we introduced anonymized begin_dir connections. --- changes/bug5283 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changes/bug5283 diff --git a/changes/bug5283 b/changes/bug5283 new file mode 100644 index 0000000000..f0325cf26c --- /dev/null +++ b/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. +