summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-07 14:24:49 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-07 14:24:49 -0400
commitfa87aa00c4096d44b71a3340f933fa4f8f23334c (patch)
tree40bcd64d5cf1502e03033f75cf678791653c3442 /src/or/rendservice.c
parentf117da3ea006fbdda3f5e921d5f8da2ae3d3bdfd (diff)
downloadtor-fa87aa00c4096d44b71a3340f933fa4f8f23334c.tar.gz
tor-fa87aa00c4096d44b71a3340f933fa4f8f23334c.zip
hs: Do not assert on rend_data while iterating over circuits
The pruning process and the deleting ephemeral service function iterates over all circuits and were asserting on rend_data for a matching circuit. This is not good because now we have v3 circuits without a rend_data. Fixes #23429 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 9edb7cc4b7..0017444b9a 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -558,7 +558,10 @@ rend_service_prune_list_impl_(void)
* matching surviving configured service. If not, close the circuit. */
while ((ocirc = circuit_get_next_service_intro_circ(ocirc))) {
int keep_it = 0;
- tor_assert(ocirc->rend_data);
+ if (ocirc->rend_data == NULL) {
+ /* This is a v3 circuit, ignore it. */
+ continue;
+ }
SMARTLIST_FOREACH_BEGIN(surviving_services, const rend_service_t *, s) {
if (rend_circuit_pk_digest_eq(ocirc, (uint8_t *) s->pk_digest)) {
/* Keep this circuit as we have a matching configured service. */
@@ -915,8 +918,8 @@ rend_service_del_ephemeral(const char *service_id)
(circ->purpose == CIRCUIT_PURPOSE_S_ESTABLISH_INTRO ||
circ->purpose == CIRCUIT_PURPOSE_S_INTRO)) {
origin_circuit_t *oc = TO_ORIGIN_CIRCUIT(circ);
- tor_assert(oc->rend_data);
- if (!rend_circuit_pk_digest_eq(oc, (uint8_t *) s->pk_digest)) {
+ if (oc->rend_data == NULL ||
+ !rend_circuit_pk_digest_eq(oc, (uint8_t *) s->pk_digest)) {
continue;
}
log_debug(LD_REND, "Closing intro point %s for service %s.",
@@ -4260,7 +4263,6 @@ rend_service_set_connection_addr_port(edge_connection_t *conn,
tor_assert(circ->base_.purpose == CIRCUIT_PURPOSE_S_REND_JOINED);
tor_assert(circ->rend_data);
log_debug(LD_REND,"beginning to hunt for addr/port");
- /* XXX: This is version 2 specific (only one supported). */
rend_pk_digest = (char *) rend_data_get_pk_digest(circ->rend_data, NULL);
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32+1,
rend_pk_digest, REND_SERVICE_ID_LEN);