[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r15152: Backport of r15149: you can't strcasecmp on 20-byte digests (in tor/branches/tor-0_2_0-patches: . src/or)



Author: kloesing
Date: 2008-06-11 19:44:13 -0400 (Wed, 11 Jun 2008)
New Revision: 15152

Modified:
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/or/rendservice.c
Log:
Backport of r15149: you can't strcasecmp on 20-byte digests
what if they contain nuls?
(worse, what if they *don't* contain nuls? ;) 

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-06-11 23:40:17 UTC (rev 15151)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-06-11 23:44:13 UTC (rev 15152)
@@ -21,6 +21,9 @@
       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

Modified: tor/branches/tor-0_2_0-patches/src/or/rendservice.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/rendservice.c	2008-06-11 23:40:17 UTC (rev 15151)
+++ tor/branches/tor-0_2_0-patches/src/or/rendservice.c	2008-06-11 23:44:13 UTC (rev 15152)
@@ -1026,8 +1026,8 @@
   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 @@
   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;
     }