diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-08-01 16:43:44 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-08-01 16:43:44 +0000 |
commit | a4e7dffc948bcbdcb8e3484f13f328afec281424 (patch) | |
tree | edd2ab16eefb2e141586c9fe48633dd8470a9c81 /src/or/dirvote.c | |
parent | 64d3e6cf659b92abf73cfab4845cdaba35509adc (diff) | |
download | tor-a4e7dffc948bcbdcb8e3484f13f328afec281424.tar.gz tor-a4e7dffc948bcbdcb8e3484f13f328afec281424.zip |
r13886@Kushana: nickm | 2007-08-01 09:43:06 -0700
Unit tests and debugging for detached signature manipulation.
svn:r11015
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 481cb1c07a..8034b7d48d 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -884,6 +884,7 @@ networkstatus_get_detached_signatures(networkstatus_vote_t *consensus) smartlist_t *elements; char buf[4096]; char *result = NULL; + int n_sigs = 0; tor_assert(consensus); tor_assert(! consensus->is_vote); @@ -911,8 +912,9 @@ networkstatus_get_detached_signatures(networkstatus_vote_t *consensus) { char sk[HEX_DIGEST_LEN+1]; char id[HEX_DIGEST_LEN+1]; - if (!v->signature || !v->good_signature) + if (!v->signature) // XXXX020 || !v->good_signature) continue; + ++n_sigs; base16_encode(sk, sizeof(sk), v->signing_key_digest, DIGEST_LEN); base16_encode(id, sizeof(id), v->identity_digest, DIGEST_LEN); tor_snprintf(buf, sizeof(buf), @@ -928,6 +930,8 @@ networkstatus_get_detached_signatures(networkstatus_vote_t *consensus) SMARTLIST_FOREACH(elements, char *, cp, tor_free(cp)); smartlist_free(elements); + if (!n_sigs) + tor_free(result); return result; } |