summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2008-06-24 20:39:47 +0000
committerKarsten Loesing <karsten.loesing@gmx.net>2008-06-24 20:39:47 +0000
commit706d1b31a942087c825b196316c3d192073c9629 (patch)
tree77bd633e25145411283a2ebf01e136ad6557bac3
parent80f03b67ef39fe613ca662bb0cf7b0371abe535d (diff)
downloadtor-706d1b31a942087c825b196316c3d192073c9629.tar.gz
tor-706d1b31a942087c825b196316c3d192073c9629.zip
Enable cannibalization of circuits for introduction circuits (backport r14166) and actually use introduction circuits that originate from cannibalization afterwards (backports r15332/r15335).
svn:r15459
-rw-r--r--ChangeLog5
-rw-r--r--src/or/circuitlist.c6
-rw-r--r--src/or/rendservice.c16
3 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 36d243fa2e..58bd429f0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@ Changes in version 0.2.0.29 - 2008-06-xx
- Fix a macro/CPP interactions that was confusing some compilers:
some GCCs don't like #if/#endif pairs inside macro arguments.
Fix for bug 707.
+ - Enable cannibalization of circuits for introduction circuits and
+ actually use introduction circuits that originate from
+ cannibalization afterwards.
Changes in version 0.2.0.28-rc - 2008-06-13
@@ -30,7 +33,7 @@ Changes in version 0.2.0.28-rc - 2008-06-13
- While setting up a hidden service, some valid introduction circuits
were overlooked and abandoned. This might be the reason for
the long delay in making a hidden service available. Bugfix on
- 0.2.0.13-alpha.
+ 0.2.0.14-alpha.
o Minor features:
- Update to the "June 9 2008" ip-to-country file.
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index f43579efbb..7bd3829f62 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -814,9 +814,9 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info,
circuit_t *_circ;
origin_circuit_t *best=NULL;
- int need_uptime = flags & CIRCLAUNCH_NEED_UPTIME;
- int need_capacity = flags & CIRCLAUNCH_NEED_CAPACITY;
- int internal = flags & CIRCLAUNCH_IS_INTERNAL;
+ int need_uptime = (flags & CIRCLAUNCH_NEED_UPTIME) != 0;
+ int need_capacity = (flags & CIRCLAUNCH_NEED_CAPACITY) != 0;
+ int internal = (flags & CIRCLAUNCH_IS_INTERNAL) != 0;
log_debug(LD_CIRC,
"Hunting for a circ to cannibalize: purpose %d, uptime %d, "
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 01b73adceb..9c41f3c0bc 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -797,6 +797,22 @@ rend_service_launch_establish_intro(rend_service_t *service,
escaped_safe_str(intro->extend_info->nickname));
return -1;
}
+
+ if (memcmp(intro->extend_info->identity_digest,
+ launched->build_state->chosen_exit->identity_digest, DIGEST_LEN)) {
+ char cann[HEX_DIGEST_LEN+1], orig[HEX_DIGEST_LEN+1];
+ base16_encode(cann, sizeof(cann),
+ launched->build_state->chosen_exit->identity_digest,
+ DIGEST_LEN);
+ base16_encode(orig, sizeof(orig),
+ intro->extend_info->identity_digest, DIGEST_LEN);
+ log_info(LD_REND, "The intro circuit we just cannibalized ends at $%s, "
+ "but we requested an intro circuit to $%s. Updating "
+ "our service.", cann, orig);
+ extend_info_free(intro->extend_info);
+ intro->extend_info = extend_info_dup(launched->build_state->chosen_exit);
+ }
+
strlcpy(launched->rend_query, service->service_id,
sizeof(launched->rend_query));
memcpy(launched->rend_pk_digest, service->pk_digest, DIGEST_LEN);