[or-cvs] rearrange to prepare to solve the authdirserver initializat...
Roger Dingledine
arma at seul.org
Wed Jul 21 07:50:08 UTC 2004
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:
rearrange to prepare to solve the authdirserver initialization
precedence problem. doesn't actually solve it yet.
Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.300
retrieving revision 1.301
diff -u -d -r1.300 -r1.301
--- main.c 21 Jul 2004 03:15:32 -0000 1.300
+++ main.c 21 Jul 2004 07:50:06 -0000 1.301
@@ -763,13 +763,6 @@
/* 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();
@@ -779,6 +772,13 @@
}
}
+ /* 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.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- router.c 21 Jul 2004 00:44:04 -0000 1.69
+++ router.c 21 Jul 2004 07:50:06 -0000 1.70
@@ -509,6 +509,8 @@
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));
if (desc_routerinfo)
routerinfo_free(desc_routerinfo);
desc_routerinfo = ri;
@@ -516,8 +518,6 @@
log_fn(LOG_WARN, "Couldn't dump router to string.");
return -1;
}
- ri->is_trusted_dir = (ri->dir_port &&
- router_digest_is_trusted_dir(ri->identity_digest));
return 0;
}
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- routerlist.c 20 Jul 2004 20:09:59 -0000 1.101
+++ routerlist.c 21 Jul 2004 07:50:06 -0000 1.102
@@ -571,6 +571,7 @@
routerinfo_t *r = smartlist_get(new_list->routers, i);
if (r->dir_port) {
char *b;
+ log_fn(LOG_DEBUG,"Trusting router %s.", r->nickname);
r->is_trusted_dir = 1;
b = tor_malloc(DIGEST_LEN);
memcpy(b, r->identity_digest, DIGEST_LEN);
More information about the tor-commits
mailing list