summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-08-13 20:31:08 +0000
committerNick Mathewson <nickm@torproject.org>2007-08-13 20:31:08 +0000
commit4e4dcb2571963a7ec6df2e34b6a7b8262396b0f4 (patch)
treed18235c41f5287def446864ef64cc4c88f01a0e4 /src/or/router.c
parent94c90c42e3883b37f392951fa1867cf94c0930d7 (diff)
downloadtor-4e4dcb2571963a7ec6df2e34b6a7b8262396b0f4.tar.gz
tor-4e4dcb2571963a7ec6df2e34b6a7b8262396b0f4.zip
r13989@Kushana: nickm | 2007-08-13 16:31:03 -0400
Actually store the v3 authority id digest of a trusteddirserver svn:r11091
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 3fa3546b79..135c115d1d 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -327,6 +327,7 @@ init_keys(void)
const char *mydesc, *datadir;
crypto_pk_env_t *prkey;
char digest[20];
+ char v3_digest[20];
char *cp;
or_options_t *options = get_options();
or_state_t *state = get_or_state();
@@ -364,8 +365,14 @@ init_keys(void)
}
/* 1a. Read v3 directory authority key/cert information. */
- if (authdir_mode(options) && options->V3AuthoritativeDir)
+ memset(v3_digest, 0, sizeof(v3_digest));
+ if (authdir_mode(options) && options->V3AuthoritativeDir) {
init_v3_authority_keys(keydir);
+ if (get_my_v3_authority_cert()) {
+ crypto_pk_get_digest(get_my_v3_authority_cert()->identity_key,
+ v3_digest);
+ }
+ }
/* 1. Read identity key. Make it if none is found. */
tor_snprintf(keydir,sizeof(keydir),
@@ -473,6 +480,7 @@ init_keys(void)
crypto_pk_get_digest(get_identity_key(), digest);
type = ((options->V1AuthoritativeDir ? V1_AUTHORITY : 0) |
(options->V2AuthoritativeDir ? V2_AUTHORITY : 0) |
+ (options->V3AuthoritativeDir ? V3_AUTHORITY : 0) |
(options->BridgeAuthoritativeDir ? BRIDGE_AUTHORITY : 0) |
(options->HSAuthoritativeDir ? HIDSERV_AUTHORITY : 0));
@@ -481,6 +489,7 @@ init_keys(void)
(uint16_t)options->DirPort,
(uint16_t)options->ORPort,
digest,
+ v3_digest,
type);
}
return 0; /* success */