From b3aaa47d3ed1ba8c2eb8edb4de18566ff1f9b19c Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Wed, 11 Jun 2008 23:44:13 +0000 Subject: [PATCH] Backport of r15149: you can't strcasecmp on 20-byte digests what if they contain nuls? (worse, what if they *don't* contain nuls? ;) svn:r15152 --- ChangeLog | 3 +++ src/or/rendservice.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4a3b342a..6762e7ffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,9 @@ Changes in version 0.2.0.28-rc - 2008-06-?? bug 688, reported by mfr. - Fix unit tests in 0.2.0.27-rc. - Fix compile on Windows. + - While setting up a hidden service, some valid introduction circuits + were overlooked and given up. This might be the reason for the long + delay in making a hidden service available. Bugfix on 0.2.0.13-alpha. Changes in version 0.2.0.27-rc - 2008-06-03 diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 21163cf0c..01b73adce 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1026,8 +1026,8 @@ find_intro_circuit(rend_intro_point_t *intro, const char *pk_digest, tor_assert(intro); while ((circ = circuit_get_next_by_pk_and_purpose(circ,pk_digest, CIRCUIT_PURPOSE_S_INTRO))) { - if (!strcasecmp(circ->build_state->chosen_exit->identity_digest, - intro->extend_info->identity_digest) && + if (!memcmp(circ->build_state->chosen_exit->identity_digest, + intro->extend_info->identity_digest, DIGEST_LEN) && circ->rend_desc_version == desc_version) { return circ; } @@ -1036,8 +1036,8 @@ find_intro_circuit(rend_intro_point_t *intro, const char *pk_digest, circ = NULL; while ((circ = circuit_get_next_by_pk_and_purpose(circ,pk_digest, CIRCUIT_PURPOSE_S_ESTABLISH_INTRO))) { - if (!strcasecmp(circ->build_state->chosen_exit->identity_digest, - intro->extend_info->identity_digest) && + if (!memcmp(circ->build_state->chosen_exit->identity_digest, + intro->extend_info->identity_digest, DIGEST_LEN) && circ->rend_desc_version == desc_version) { return circ; }