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

[or-cvs] solve the authdirserver initialization precedence problem



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	main.c router.c routerlist.c 
Log Message:
solve the authdirserver initialization precedence problem


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.301
retrieving revision 1.302
diff -u -d -r1.301 -r1.302
--- main.c	21 Jul 2004 07:50:06 -0000	1.301
+++ main.c	21 Jul 2004 18:53:56 -0000	1.302
@@ -763,6 +763,13 @@
   /* Intialize the service cache. */
   rend_cache_init();
 
+  /* load the private keys, if we're supposed to have them, and set up the
+   * TLS context. */
+  if (init_keys() < 0 || rend_service_load_keys() < 0) {
+    log_fn(LOG_ERR,"Error initializing keys; exiting");
+    return -1;
+  }
+
   /* load the routers file */
   if(options.RouterFile) {
     routerlist_clear_trusted_directories();
@@ -772,13 +779,6 @@
     }
   }
 
-  /* load the private keys, if we're supposed to have them, and set up the
-   * TLS context. */
-  if (init_keys() < 0 || rend_service_load_keys() < 0) {
-    log_fn(LOG_ERR,"Error initializing keys; exiting");
-    return -1;
-  }
-
   if(authdir_mode()) {
     /* the directory is already here, run startup things */
     directory_has_arrived();

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- router.c	21 Jul 2004 07:50:06 -0000	1.70
+++ router.c	21 Jul 2004 18:53:56 -0000	1.71
@@ -509,8 +509,7 @@
   ri->bandwidthburst = options.BandwidthBurst;
   ri->exit_policy = NULL; /* zero it out first */
   router_add_exit_policy_from_config(ri);
-  ri->is_trusted_dir = (ri->dir_port &&
-    router_digest_is_trusted_dir(ri->identity_digest));
+  ri->is_trusted_dir = authdir_mode();
   if (desc_routerinfo)
     routerinfo_free(desc_routerinfo);
   desc_routerinfo = ri;

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- routerlist.c	21 Jul 2004 09:35:24 -0000	1.104
+++ routerlist.c	21 Jul 2004 18:53:56 -0000	1.105
@@ -310,6 +310,7 @@
   return NULL;
 }
 
+/* XXX008 currently this trusted_dir_digests stuff is not used. */
 /** Return true iff <b>digest</b> is the digest of the identity key of
  * a trusted directory. */
 int router_digest_is_trusted_dir(const char *digest) {