[or-cvs] r11102: Fix a logic error in certificate handling (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Aug 14 14:30:25 UTC 2007


Author: nickm
Date: 2007-08-14 10:30:25 -0400 (Tue, 14 Aug 2007)
New Revision: 11102

Modified:
   tor/trunk/
   tor/trunk/src/or/routerlist.c
Log:
 r14009 at Kushana:  nickm | 2007-08-14 10:20:20 -0400
 Fix a logic error in certificate handling



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r14009] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-08-14 13:34:41 UTC (rev 11101)
+++ tor/trunk/src/or/routerlist.c	2007-08-14 14:30:25 UTC (rev 11102)
@@ -182,6 +182,8 @@
   char filename[512];
   char *s;
 
+  /* XXXX020 Suppress warnings if cached consensus is bad. */
+
   tor_snprintf(filename,sizeof(filename),"%s"PATH_SEPARATOR"cached-consensus",
                get_options()->DataDirectory);
   s = read_file_to_str(filename, RFTS_IGNORE_MISSING, NULL);
@@ -244,9 +246,9 @@
 
     SMARTLIST_FOREACH(ds->v3_certs, authority_cert_t *, c,
       {
-        if (memcmp(c->cache_info.signed_descriptor_digest,
-                   cert->cache_info.signed_descriptor_digest,
-                   DIGEST_LEN)) {
+        if (!memcmp(c->cache_info.signed_descriptor_digest,
+                    cert->cache_info.signed_descriptor_digest,
+                    DIGEST_LEN)) {
           /* we already have this one. continue. */
           authority_cert_free(cert);
           found = 1;



More information about the tor-commits mailing list