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/dirserv.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/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index f26a6bb216..5b103bcf52 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1993,6 +1993,16 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version, smartlist_add_asprintf(chunks, "p %s\n", summary); tor_free(summary); } + + if (format == NS_V3_VOTE && vrs) { + if (tor_mem_is_zero((char*)vrs->ed25519_id, ED25519_PUBKEY_LEN)) { + smartlist_add(chunks, tor_strdup("id ed25519 none\n")); + } else { + char ed_b64[BASE64_DIGEST256_LEN+1]; + digest256_to_base64(ed_b64, (const char*)vrs->ed25519_id); + smartlist_add_asprintf(chunks, "id ed25519 %s\n", ed_b64); + } + } } done: @@ -2815,6 +2825,11 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, listbadexits, vote_on_hsdirs); + if (ri->signing_key_cert) { + memcpy(vrs->ed25519_id, ri->signing_key_cert->signing_key.pubkey, + ED25519_PUBKEY_LEN); + } + if (digestmap_get(omit_as_sybil, ri->cache_info.identity_digest)) clear_status_flags_on_sybil(rs); |