summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-09 04:15:46 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-09 04:15:46 +0000
commitceac39aa8aa498a39b2e83f87a776bd7c225846b (patch)
tree2546300e02093a2984dd8f1d60a6a65a936f9407 /src/or/router.c
parent66f9240eb57da944d10f134ed0d3f0110e289a18 (diff)
downloadtor-ceac39aa8aa498a39b2e83f87a776bd7c225846b.tar.gz
tor-ceac39aa8aa498a39b2e83f87a776bd7c225846b.zip
r12697@catbus: nickm | 2007-05-09 00:15:40 -0400
Change authority_type_t to a set of flags; use it more consistently. svn:r10144
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/router.c b/src/or/router.c
index b6c4ca69cb..17470cc5f9 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -242,6 +242,7 @@ init_keys(void)
char *cp;
or_options_t *options = get_options();
or_state_t *state = get_or_state();
+ authority_type_t type;
if (!key_lock)
key_lock = tor_mutex_new();
@@ -371,15 +372,17 @@ init_keys(void)
}
/* 6b. [authdirserver only] add own key to approved directories. */
crypto_pk_get_digest(get_identity_key(), digest);
+ type = ((options->V1AuthoritativeDir ? V1_AUTHORITY : 0) |
+ (options->V2AuthoritativeDir ? V2_AUTHORITY : 0) |
+ (options->BridgeAuthoritativeDir ? BRIDGE_AUTHORITY : 0) |
+ (options->HSAuthoritativeDir ? HIDSERV_AUTHORITY : 0));
+
if (!router_digest_is_trusted_dir(digest)) {
add_trusted_dir_server(options->Nickname, NULL,
(uint16_t)options->DirPort,
(uint16_t)options->ORPort,
digest,
- options->V1AuthoritativeDir, /* v1 authority */
- options->V2AuthoritativeDir, /* v2 authority */
- options->BridgeAuthoritativeDir, /* bridge auth */
- options->HSAuthoritativeDir /*hidserv authority*/);
+ type);
}
return 0; /* success */
}