diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-10-29 13:36:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-05-28 10:42:29 -0400 |
commit | 525383c46d1430abf680133e486fc532050d7123 (patch) | |
tree | 3e4959911477becf970ca6150c3b82a860437abf /src/or/dirvote.c | |
parent | 0b819a2a7c8a79a222ffd8af0b239133f9becd7c (diff) | |
download | tor-525383c46d1430abf680133e486fc532050d7123.tar.gz tor-525383c46d1430abf680133e486fc532050d7123.zip |
Checkpoint some work on voting on ed25519 identities
* Include ed25519 identities in votes
* Include "no ed25519 identity" in votes
* Include some commented-out code about identity voting. (This
will disappear.)
* Include some functions for identity voting (These will disappear.)
* Enforce uniqueness in ed25519 keys within a vote
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 94b4e5136a..6c53b3c642 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -782,6 +782,28 @@ networkstatus_check_weights(int64_t Wgg, int64_t Wgd, int64_t Wmg, return berr; } +#if 0 +/** DOCDOC */ +static vote_identity_map_t * +networkstatus_compute_identity_mapping(const smartlist_t *votes) +{ + vote_identity_map_t *map = vote_identity_map_new(); + + SMARTLIST_FOREACH_BEGIN(votes, networkstatus_t *, vote) { + SMARTLIST_FOREACH_BEGIN(vote->routerstatus_list, + vote_routerstatus_t *, vrs) { + vote_identity_map_add(map, vrs->status.identity_digest, + vrs->has_ed25519_listing ? vrs->ed25519_id : NULL, + vote_sl_idx); + } SMARTLIST_FOREACH_END(vrs); + } SMARTLIST_FOREACH_END(vote); + + vote_identity_map_resolve(map); + + return map; +} +#endif + /** * This function computes the bandwidth weights for consensus method 10. * @@ -1139,6 +1161,9 @@ networkstatus_compute_consensus(smartlist_t *votes, char *params = NULL; char *packages = NULL; int added_weights = 0; +#if 0 + vote_identity_map_t *id_map = NULL; +#endif tor_assert(flavor == FLAV_NS || flavor == FLAV_MICRODESC); tor_assert(total_authorities >= smartlist_len(votes)); @@ -1494,6 +1519,10 @@ networkstatus_compute_consensus(smartlist_t *votes, } ); +#if 0 + id_map = networkstatus_compute_identity_mapping(votes); +#endif + /* Now go through all the votes */ flag_counts = tor_calloc(smartlist_len(flags), sizeof(int)); while (1) { @@ -1981,6 +2010,9 @@ networkstatus_compute_consensus(smartlist_t *votes, done: +#if 0 + vote_identity_map_free(id_map); +#endif tor_free(client_versions); tor_free(server_versions); tor_free(packages); |