summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-05-12 02:14:01 +0000
committerNick Mathewson <nickm@torproject.org>2008-05-12 02:14:01 +0000
commitf3f6ecef48b019fe18fac371b64c3f3466ef3388 (patch)
tree29075075ca19e72f6e593c31ca0db4092ba5741b /src/or/routerparse.c
parentb7a80920e26f53e354975a7252e3a1f33ef9192b (diff)
downloadtor-f3f6ecef48b019fe18fac371b64c3f3466ef3388.tar.gz
tor-f3f6ecef48b019fe18fac371b64c3f3466ef3388.zip
r19690@catbus: nickm | 2008-05-11 22:13:31 -0400
Implement a proposal to let a directory authority migrate its identity key without ceasing to sign consensuses. svn:r14584
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 016b938ae9..f140d5d5fe 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -79,6 +79,7 @@ typedef enum {
K_CONSENSUS_DIGEST,
K_CONSENSUS_METHODS,
K_CONSENSUS_METHOD,
+ K_LEGACY_DIR_KEY,
A_PURPOSE,
_A_UNKNOWN,
@@ -365,6 +366,7 @@ static token_rule_t networkstatus_token_table[] = {
T0N("opt", K_OPT, CONCAT_ARGS, OBJ_OK ),
T1( "contact", K_CONTACT, CONCAT_ARGS, NO_OBJ ),
T1( "dir-source", K_DIR_SOURCE, GE(6), NO_OBJ ),
+ T01("legacy-dir-key", K_LEGACY_DIR_KEY, GE(1), NO_OBJ ),
T1( "known-flags", K_KNOWN_FLAGS, CONCAT_ARGS, NO_OBJ ),
T01("client-versions", K_CLIENT_VERSIONS, CONCAT_ARGS, NO_OBJ ),
T01("server-versions", K_SERVER_VERSIONS, CONCAT_ARGS, NO_OBJ ),
@@ -2282,6 +2284,23 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
goto err;
}
+ if (is_vote &&
+ (tok = find_first_by_keyword(tokens, K_LEGACY_DIR_KEY))) {
+ int bad = 1;
+ if (strlen(tok->args[0]) == HEX_DIGEST_LEN) {
+ networkstatus_voter_info_t *voter = smartlist_get(ns->voters, 0);
+ if (base16_decode(voter->legacy_id_digest, DIGEST_LEN,
+ tok->args[0], HEX_DIGEST_LEN)<0)
+ bad = 1;
+ else
+ bad = 0;
+ }
+ if (bad) {
+ log_warn(LD_DIR, "Invalid legacy key digest %s on vote.",
+ escaped(tok->args[0]));
+ }
+ }
+
/* Parse routerstatus lines. */
rs_tokens = smartlist_create();
rs_area = memarea_new(512);