diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-05 11:28:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-05 11:31:24 -0400 |
commit | 4a621a50f53ebeac62d30f427c2db0c627f80a31 (patch) | |
tree | 96d2a46e8059f726b120ce7790e1e3a7ec2a4f96 /src/or/dirvote.c | |
parent | 5d496963b4a98512711bd4cbc5565535d89e7845 (diff) | |
download | tor-4a621a50f53ebeac62d30f427c2db0c627f80a31.tar.gz tor-4a621a50f53ebeac62d30f427c2db0c627f80a31.zip |
Consensus method 18: Add a base64 ID digest to the microdesc
This is a stopgap measure to make sure that microdescriptors never
collide; see bug 11743.
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 4d3ee9cdb3..8b51306d15 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -3588,6 +3588,12 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method) tor_free(p6); } + if (consensus_method >= MIN_METHOD_FOR_ID_HASH_IN_MD) { + char idbuf[BASE64_DIGEST_LEN+1]; + digest_to_base64(idbuf, ri->cache_info.identity_digest); + smartlist_add_asprintf(chunks, "id %s\n", idbuf); + } + output = smartlist_join_strings(chunks, "", 0, NULL); { @@ -3657,7 +3663,8 @@ static const struct consensus_method_range_t { {MIN_METHOD_FOR_MICRODESC, MIN_METHOD_FOR_A_LINES - 1}, {MIN_METHOD_FOR_A_LINES, MIN_METHOD_FOR_P6_LINES - 1}, {MIN_METHOD_FOR_P6_LINES, MIN_METHOD_FOR_NTOR_KEY - 1}, - {MIN_METHOD_FOR_NTOR_KEY, MAX_SUPPORTED_CONSENSUS_METHOD}, + {MIN_METHOD_FOR_NTOR_KEY, MIN_METHOD_FOR_ID_HASH_IN_MD - 1}, + {MIN_METHOD_FOR_ID_HASH_IN_MD, MAX_SUPPORTED_CONSENSUS_METHOD}, {-1, -1} }; |