diff options
author | Roger Dingledine <arma@torproject.org> | 2004-07-21 18:53:56 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-07-21 18:53:56 +0000 |
commit | ce7fcd110ca0a7acb2d8473fddb51ae42a9aeae0 (patch) | |
tree | 68f53f1292a2cd2f1deb6d91867a8dac3e1c3a1c /src | |
parent | 1e62d24ddc3e28fed81739f0184fe8cf3a2ee51e (diff) | |
download | tor-ce7fcd110ca0a7acb2d8473fddb51ae42a9aeae0.tar.gz tor-ce7fcd110ca0a7acb2d8473fddb51ae42a9aeae0.zip |
solve the authdirserver initialization precedence problem
svn:r2085
Diffstat (limited to 'src')
-rw-r--r-- | src/or/main.c | 14 | ||||
-rw-r--r-- | src/or/router.c | 3 | ||||
-rw-r--r-- | src/or/routerlist.c | 1 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/or/main.c b/src/or/main.c index b3898fff39..759487c0ae 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -763,6 +763,13 @@ static int do_main_loop(void) { /* 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 @@ static int do_main_loop(void) { } } - /* 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(); diff --git a/src/or/router.c b/src/or/router.c index c0f3cbce6d..f28778f0e3 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -509,8 +509,7 @@ int router_rebuild_descriptor(void) { 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; diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 95b0a033cd..7f8e466416 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -310,6 +310,7 @@ routerinfo_t *router_get_by_nickname(const char *nickname) 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) { |