diff options
author | Roger Dingledine <arma@torproject.org> | 2008-06-11 22:46:31 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2008-06-11 22:46:31 +0000 |
commit | 6bd006bdb8e46a5fa21230e649cf6742bb0856d5 (patch) | |
tree | c927710fc9c10257083e5505f2944ab44bf8b89e /src | |
parent | dedcc7c34bd4eafba5aaaa217595104d55821cdc (diff) | |
download | tor-6bd006bdb8e46a5fa21230e649cf6742bb0856d5.tar.gz tor-6bd006bdb8e46a5fa21230e649cf6742bb0856d5.zip |
you can't strcasecmp on 20-byte digests
what if they contain nuls?
(worse, what if they *don't* contain nuls? ;)
svn:r15149
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 bf5eb3889a..f5009185e0 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; } |