aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-04-27 10:26:09 +0000
committerRoger Dingledine <arma@torproject.org>2007-04-27 10:26:09 +0000
commit397afcc3f667f02de3599ab3ba53638b484853b7 (patch)
treef665acb174529ea2bb1f128f0ace2b4c2315e58a /src/or/circuituse.c
parent3d00738ec72e87d5d67f1c44f0a73217650a6a65 (diff)
downloadtor-397afcc3f667f02de3599ab3ba53638b484853b7.tar
tor-397afcc3f667f02de3599ab3ba53638b484853b7.tar.gz
Make PreferTunneledDirConns and TunnelDirConns work even when
we have no cached directory info. This means Tor clients can now do all of their connections protected by TLS. svn:r10035
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index fd0e609d2..8b3e1a8f1 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -91,10 +91,18 @@ circuit_is_acceptable(circuit_t *circ, edge_connection_t *conn,
log_debug(LD_CIRC,"Skipping one-hop circuit.");
return 0;
}
+ tor_assert(conn->chosen_exit_name);
+ if (build_state->chosen_exit) {
+ char digest[DIGEST_LEN];
+ if (hexdigest_to_digest(conn->chosen_exit_name, digest) < 0 ||
+ memcmp(digest, build_state->chosen_exit->identity_digest,
+ DIGEST_LEN))
+ return 0; /* this is a circuit to somewhere else */
+ }
} else {
if (conn->socks_request->command == SOCKS_COMMAND_CONNECT_DIR) {
/* don't use three-hop circuits -- that could hurt our anonymity. */
- log_debug(LD_CIRC,"Skipping multi-hop circuit for CONNECT_DIR.");
+// log_debug(LD_CIRC,"Skipping multi-hop circuit for CONNECT_DIR.");
return 0;
}
}