From 8bf32223d714b67e176bf79eea4cd3fb2e578d55 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sun, 14 Oct 2007 07:51:39 +0000 Subject: [PATCH] backport r11499, r11500, r11501: hidserv hexdigests rather than nicknames svn:r11922 --- ChangeLog | 7 +++++++ doc/TODO.012 | 2 +- src/or/rendcommon.c | 2 +- src/or/rendservice.c | 7 ++++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 078ba2ef14..a83634e391 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ Changes in version 0.1.2.18 - 2007-??-?? o Major bugfixes: - Fix possible segfaults in functions called from rend_process_relay_cell(). + - Hidden services were choosing introduction points uniquely by + hexdigest, but when constructing the hidden service descriptor + they merely wrote the (potentially ambiguous) nickname. + - Clients now use the v2 intro format for hidden service + connections: they specify their chosen rendezvous point by identity + digest rather than by (potentially ambiguous) nickname. These + changes could speed up hidden service connections dramatically. o Minor bugfixes: - Don't try to access (or alter) the state file when running diff --git a/doc/TODO.012 b/doc/TODO.012 index d61f651192..1536c6f659 100644 --- a/doc/TODO.012 +++ b/doc/TODO.012 @@ -12,7 +12,7 @@ Backport for 0.1.2.x once better tested: P - r10579: new addsysuser implementation for osx (??) D r11287: Reject address mappings to internal addresses. (??) (this will break some existing test-network configurations, yes?) -R - r11499, r11500, r11501: hidserv hexdigests rather than nicknames + o r11499, r11500, r11501: hidserv hexdigests rather than nicknames P - r11548, the osx /tmp fix N - r11829: Don't warn when cancel_pending_resolve() finds a cached failure. R - r11915: just because you hup, don't publish a near-duplicate descriptor diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index 287d089459..a90f6a6116 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -146,7 +146,7 @@ rend_parse_service_descriptor(const char *str, size_t len) result->protocols = ntohs(get_uint16(cp)); cp += 2; } else { - result->protocols = 1; + result->protocols = 1<<2; /* always use intro format 2 */ } if (end-cp < 2) goto truncated; result->n_intro_points = ntohs(get_uint16(cp)); diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 3b509a0e4b..0e05dc23f7 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -303,16 +303,17 @@ rend_service_update_descriptor(rend_service_t *service) d->intro_point_extend_info = tor_malloc_zero(sizeof(extend_info_t*)*n); d->protocols = (1<<2) | (1<<0); /* We support protocol 2 and protocol 0. */ for (i=0; i < n; ++i) { - router = router_get_by_nickname(smartlist_get(service->intro_nodes, i),1); + const char *name = smartlist_get(service->intro_nodes, i); + router = router_get_by_nickname(name, 1); if (!router) { log_info(LD_REND,"Router '%s' not found for intro point %d. Skipping.", - safe_str((char*)smartlist_get(service->intro_nodes, i)), i); + safe_str(name), i); continue; } circ = find_intro_circuit(router, service->pk_digest); if (circ && circ->_base.purpose == CIRCUIT_PURPOSE_S_INTRO) { /* We have an entirely established intro circuit. */ - d->intro_points[d->n_intro_points] = tor_strdup(router->nickname); + d->intro_points[d->n_intro_points] = tor_strdup(name); d->intro_point_extend_info[d->n_intro_points] = extend_info_from_router(router); d->n_intro_points++;