diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-06-04 22:29:00 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-06-04 22:29:00 +0000 |
commit | 8b0e6a446697ad3d15a1fe23a8c5c3ed53a60c70 (patch) | |
tree | d2dcdf0c97e3db1bf4852bcb0b96102c6a120bae /src/or/dirserv.c | |
parent | 8d1224eb51bf0f9fd0c829aa7fb22e359513b71b (diff) | |
download | tor-8b0e6a446697ad3d15a1fe23a8c5c3ed53a60c70.tar.gz tor-8b0e6a446697ad3d15a1fe23a8c5c3ed53a60c70.zip |
r13250@catbus: nickm | 2007-06-04 18:28:55 -0400
Adapt code to parse v3 networkstatus votes so it can also parse a consensus. Make networkstatus_vote_t the catch-all type for votes and conensuses. Correct/clarify the second argument to directory-signature.
svn:r10491
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 616c8e4d41..6852984c43 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1897,19 +1897,19 @@ generate_networkstatus_opinion(int v2) } outp += strlen(outp); } else { - char hex_digest[HEX_DIGEST_LEN+1]; - if (tor_snprintf(outp, endp-outp, "directory-signature %s ", - fingerprint)<0) { + char signing_key_fingerprint[FINGERPRINT_LEN+1]; + if (tor_snprintf(outp, endp-outp, "directory-signature ")<0) { log_warn(LD_BUG, "Unable to start signature line."); goto done; } - if (router_get_networkstatus_v3_hash(status, digest)<0) { - log_warn(LD_BUG, "Unable to hash network status vote"); + outp += strlen(outp); + + if (crypto_pk_get_fingerprint(private_key, signing_key_fingerprint, 0)<0) { + log_warn(LD_BUG, "Unable to get fingerprint for signing key"); goto done; } - base16_encode(hex_digest, sizeof(hex_digest), digest, DIGEST_LEN); - outp += strlen(outp); - if (tor_snprintf(outp, endp-outp, "%s\n", hex_digest)<0) { + if (tor_snprintf(outp, endp-outp, "%s %s\n", fingerprint, + signing_key_fingerprint)<0) { log_warn(LD_BUG, "Unable to end signature line."); goto done; } |