From 525383c46d1430abf680133e486fc532050d7123 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 29 Oct 2014 13:36:21 -0400 Subject: 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 --- src/or/dirserv.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/or/dirserv.c') 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); -- cgit v1.2.3-54-g00ecf