diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-09-16 17:01:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-10-15 15:17:13 -0400 |
commit | 3b2fc659a8ef83feedadcda32de49db06b80af10 (patch) | |
tree | 9df2972d2278f44f8e4fcfa6396aa45cc0d2e6db /src/or/dirserv.c | |
parent | e1ddee8bbe724e934fe9a4cb2d290719a7d6105c (diff) | |
download | tor-3b2fc659a8ef83feedadcda32de49db06b80af10.tar.gz tor-3b2fc659a8ef83feedadcda32de49db06b80af10.zip |
Refactor consensus signature storage for multiple digests and flavors.
This patch introduces a new type called document_signature_t to represent the
signature of a consensus document. Now, each consensus document can have up
to one document signature per voter per digest algorithm. Also, each
detached-signatures document can have up to one signature per <voter,
algorithm, flavor>.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index e7a58edfc1..326a801c41 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2597,12 +2597,17 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key, voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t)); voter->nickname = tor_strdup(options->Nickname); memcpy(voter->identity_digest, identity_digest, DIGEST_LEN); + voter->sigs = smartlist_create(); + { + document_signature_t *sig = tor_malloc_zero(sizeof(document_signature_t)); + memcpy(sig->identity_digest, identity_digest, DIGEST_LEN); + memcpy(sig->signing_key_digest, signing_key_digest, DIGEST_LEN); + } voter->address = hostname; voter->addr = addr; voter->dir_port = options->DirPort; voter->or_port = options->ORPort; voter->contact = tor_strdup(contact); - memcpy(voter->signing_key_digest, signing_key_digest, DIGEST_LEN); if (options->V3AuthUseLegacyKey) { authority_cert_t *c = get_my_v3_legacy_cert(); if (c) { |