[or-cvs] make sure router descriptor doesnt eat the directory-signat...

Nick Mathewson nickm at seul.org
Tue Sep 30 20:04:42 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv4158/src/or

Modified Files:
	dirserv.c 
Log Message:
make sure router descriptor doesnt eat the directory-signature

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dirserv.c	30 Sep 2003 19:27:54 -0000	1.6
+++ dirserv.c	30 Sep 2003 20:04:40 -0000	1.7
@@ -198,9 +198,10 @@
     log(LOG_WARNING, "no descriptor found.");
     goto err;
   }
-  end = strstr(start+6, "\nrouter ");
-  if (end) {
+  if ((end = strstr(start+6, "\nrouter "))) {
     ++end; /* Include NL. */
+  } else if ((end = strstr(start+6, "\ndirectory-signature"))) {
+    ++end;
   } else {
     end = start+strlen(start);
   }
@@ -336,6 +337,9 @@
     log_fn(LOG_WARNING,"couldn't sign digest");
     return -1;
   }
+  log(LOG_DEBUG,"generated directory digest begins with %02x:%02x:%02x:%02x",
+      ((int)digest[0])&0xff,((int)digest[1])&0xff,
+      ((int)digest[2])&0xff,((int)digest[3])&0xff);
   
   strncpy(cp, 
           "-----BEGIN SIGNATURE-----\n", maxlen-i);



More information about the tor-commits mailing list