mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
solve the authdirserver initialization precedence problem
svn:r2085
This commit is contained in:
parent
1e62d24ddc
commit
ce7fcd110c
@ -763,6 +763,13 @@ static int do_main_loop(void) {
|
|||||||
/* Intialize the service cache. */
|
/* Intialize the service cache. */
|
||||||
rend_cache_init();
|
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 */
|
/* load the routers file */
|
||||||
if(options.RouterFile) {
|
if(options.RouterFile) {
|
||||||
routerlist_clear_trusted_directories();
|
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()) {
|
if(authdir_mode()) {
|
||||||
/* the directory is already here, run startup things */
|
/* the directory is already here, run startup things */
|
||||||
directory_has_arrived();
|
directory_has_arrived();
|
||||||
|
@ -509,8 +509,7 @@ int router_rebuild_descriptor(void) {
|
|||||||
ri->bandwidthburst = options.BandwidthBurst;
|
ri->bandwidthburst = options.BandwidthBurst;
|
||||||
ri->exit_policy = NULL; /* zero it out first */
|
ri->exit_policy = NULL; /* zero it out first */
|
||||||
router_add_exit_policy_from_config(ri);
|
router_add_exit_policy_from_config(ri);
|
||||||
ri->is_trusted_dir = (ri->dir_port &&
|
ri->is_trusted_dir = authdir_mode();
|
||||||
router_digest_is_trusted_dir(ri->identity_digest));
|
|
||||||
if (desc_routerinfo)
|
if (desc_routerinfo)
|
||||||
routerinfo_free(desc_routerinfo);
|
routerinfo_free(desc_routerinfo);
|
||||||
desc_routerinfo = ri;
|
desc_routerinfo = ri;
|
||||||
|
@ -310,6 +310,7 @@ routerinfo_t *router_get_by_nickname(const char *nickname)
|
|||||||
return NULL;
|
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
|
/** Return true iff <b>digest</b> is the digest of the identity key of
|
||||||
* a trusted directory. */
|
* a trusted directory. */
|
||||||
int router_digest_is_trusted_dir(const char *digest) {
|
int router_digest_is_trusted_dir(const char *digest) {
|
||||||
|
Loading…
Reference in New Issue
Block a user