diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2008-06-11 23:44:13 +0000 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2008-06-11 23:44:13 +0000 |
commit | b3aaa47d3ed1ba8c2eb8edb4de18566ff1f9b19c (patch) | |
tree | 79baf8f8e1e0622ce0d91befc9bbe5ad7af4abe5 /src | |
parent | 1fde6994d5f6f24975dc7d6b4d3e4c2ce7a25631 (diff) | |
download | tor-b3aaa47d3ed1ba8c2eb8edb4de18566ff1f9b19c.tar.gz tor-b3aaa47d3ed1ba8c2eb8edb4de18566ff1f9b19c.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/or/rendservice.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 21163cf0c2..01b73adceb 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; } |