summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-10-07 21:38:44 +0000
committerNick Mathewson <nickm@torproject.org>2005-10-07 21:38:44 +0000
commit2572db2472812c6b48f1fde16cc5d7866135f799 (patch)
treede2a6f0146da1f424cdb3f4c7c9adcdf50bcdaa5
parent5569e49a6c3ea8101316044991e6bc3a6c2404e5 (diff)
downloadtor-2572db2472812c6b48f1fde16cc5d7866135f799.tar.gz
tor-2572db2472812c6b48f1fde16cc5d7866135f799.zip
Warn less about intro nodes by nickname; remember our own intro nodes by key.
svn:r5224
-rw-r--r--src/or/rendservice.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 2b456e3358..6ccec6744a 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -934,7 +934,7 @@ rend_services_introduce(void)
/* Find out which introduction points we have in progress for this service. */
for (j=0; j < smartlist_len(service->intro_nodes); ++j) {
intro = smartlist_get(service->intro_nodes, j);
- router = router_get_by_nickname(intro, 1);
+ router = router_get_by_nickname(intro, 0);
if (!router || !find_intro_circuit(router,service->pk_digest)) {
log_fn(LOG_INFO,"Giving up on %s as intro point for %s.",
intro, service->service_id);
@@ -963,6 +963,7 @@ rend_services_introduce(void)
smartlist_add_all(exclude_routers, intro_routers);
/* The directory is now here. Pick three ORs as intro points. */
for (j=prev_intro_nodes; j < NUM_INTRO_POINTS; ++j) {
+ char *hex_digest;
router = router_choose_random_node(service->intro_prefer_nodes,
service->intro_exclude_nodes, exclude_routers, 1, 0,
get_options()->_AllowUnverified & ALLOW_UNVERIFIED_INTRODUCTION, 0);
@@ -972,10 +973,13 @@ rend_services_introduce(void)
break;
}
changed = 1;
+ hex_digest = tor_malloc_zero(HEX_DIGEST_LEN+2);
+ hex_digest[0] = '$';
+ base16_encode(hex_digest+1, HEX_DIGEST_LEN+1, router->identity_digest,
+ DIGEST_LEN);
smartlist_add(intro_routers, router);
smartlist_add(exclude_routers, router);
-/*XXX009 should strdup the hexdigest, not nickname */
- smartlist_add(service->intro_nodes, tor_strdup(router->nickname));
+ smartlist_add(service->intro_nodes, hex_digest);
log_fn(LOG_INFO,"Picked router %s as an intro point for %s.", router->nickname,
service->service_id);
}