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

[or-cvs] Directory authorities should go to the proper authority whe...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv23218/src/or

Modified Files:
	directory.c 
Log Message:
Directory authorities should go to the proper authority when asking for a networkstatus, even when they want a compressed one.  (Also, bullet-proof the logic in case we ever accidentally request a networkstatus for a non-authority.)

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.333
retrieving revision 1.334
diff -u -p -d -r1.333 -r1.334
--- directory.c	29 Dec 2005 04:57:19 -0000	1.333
+++ directory.c	6 Jan 2006 18:05:48 -0000	1.334
@@ -167,13 +167,14 @@ directory_get_from_dirserver(uint8_t pur
 
   if (directconn) {
     if (fetch_fresh_first && purpose == DIR_PURPOSE_FETCH_NETWORKSTATUS &&
-        !strcmpstart(resource,"fp/") && strlen(resource) == HEX_DIGEST_LEN+3) {
+        !strcmpstart(resource,"fp/") && strlen(resource) >= HEX_DIGEST_LEN+3) {
       /* Try to ask the actual dirserver its opinion. */
       char digest[DIGEST_LEN];
       trusted_dir_server_t *ds;
       base16_decode(digest, DIGEST_LEN, resource+3, HEX_DIGEST_LEN);
       ds = router_get_trusteddirserver_by_digest(digest);
-      rs = &(ds->fake_status);
+      if (ds)
+        rs = &(ds->fake_status);
     }
     if (!rs && fetch_fresh_first) {
       /* only ask authdirservers, and don't ask myself */