aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-12-05 00:15:42 +0000
committerRoger Dingledine <arma@torproject.org>2005-12-05 00:15:42 +0000
commit26b49dbc09249b30dd734c28be7e4d0a1eb7ed58 (patch)
treef82c5cc4fd031f0540a3f04d6e1ebc191bcf4fca /src/or
parent40cbe550f3713e08b1275ce2703dcf3e4882e5b6 (diff)
downloadtor-26b49dbc09249b30dd734c28be7e4d0a1eb7ed58.tar.gz
tor-26b49dbc09249b30dd734c28be7e4d0a1eb7ed58.zip
Bugfix for trackhostexits: write down the fingerprint of the chosen exit,
not its nickname, because the chosen exit might not be verified. svn:r5499
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuituse.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 512b492924..4afa2f5ea3 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1030,6 +1030,7 @@ consider_recording_trackhost(connection_t *conn, circuit_t *circ)
or_options_t *options = get_options();
size_t len;
char *new_address;
+ char fp[HEX_DIGEST_LEN+1];
/* Search the addressmap for this conn's destination. */
/* If he's not in the address map.. */
@@ -1054,16 +1055,19 @@ consider_recording_trackhost(connection_t *conn, circuit_t *circ)
if (!found_needle || !circ->build_state->chosen_exit)
return;
+ /* write down the fingerprint of the chosen exit, not the nickname,
+ * because the chosen exit might not be verified. */
+ base16_encode(fp, sizeof(fp),
+ circ->build_state->chosen_exit->identity_digest, DIGEST_LEN);
+
/* Add this exit/hostname pair to the addressmap. */
len = strlen(conn->socks_request->address) + 1 /* '.' */ +
- strlen(circ->build_state->chosen_exit->nickname) + 1 /* '.' */ +
+ strlen(fp) + 1 /* '.' */ +
strlen("exit") + 1 /* '\0' */;
new_address = tor_malloc(len);
- //XXX need to use $key not nickname
tor_snprintf(new_address, len, "%s.%s.exit",
- conn->socks_request->address,
- circ->build_state->chosen_exit->nickname);
+ conn->socks_request->address, fp);
addressmap_register(conn->socks_request->address, new_address,
time(NULL) + options->TrackHostExitsExpire);