summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-09-14 11:57:19 -0400
committerNick Mathewson <nickm@torproject.org>2009-10-15 15:17:12 -0400
commit8b2f6b27fdc03f12d092d37c42d1995ff7426916 (patch)
treee43bd2156f445597940f0b9b386920811e7a38de /src/or/dirvote.c
parent8d41e6c47126fb467858f98b06ab7460dcc6647b (diff)
downloadtor-8b2f6b27fdc03f12d092d37c42d1995ff7426916.tar.gz
tor-8b2f6b27fdc03f12d092d37c42d1995ff7426916.zip
Make signature-generation code handle different key and digest lengths.
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 358246ae9d..4e94eb67e6 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -192,7 +192,7 @@ format_networkstatus_vote(crypto_pk_env_t *private_signing_key,
if (router_get_networkstatus_v3_hash(status, digest)<0)
goto err;
note_crypto_pk_op(SIGN_DIR);
- if (router_append_dirobj_signature(outp,endp-outp,digest,
+ if (router_append_dirobj_signature(outp,endp-outp,digest, DIGEST_LEN,
private_signing_key)<0) {
log_warn(LD_BUG, "Unable to sign networkstatus vote.");
goto err;
@@ -1257,7 +1257,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
tor_snprintf(buf, sizeof(buf), "%s %s\n", fingerprint,
signing_key_fingerprint);
/* And the signature. */
- if (router_append_dirobj_signature(buf, sizeof(buf), digest,
+ if (router_append_dirobj_signature(buf, sizeof(buf), digest, DIGEST_LEN,
signing_key)) {
log_warn(LD_BUG, "Couldn't sign consensus networkstatus.");
return NULL; /* This leaks, but it should never happen. */
@@ -1272,7 +1272,7 @@ networkstatus_compute_consensus(smartlist_t *votes,
signing_key_fingerprint, 0);
tor_snprintf(buf, sizeof(buf), "%s %s\n", fingerprint,
signing_key_fingerprint);
- if (router_append_dirobj_signature(buf, sizeof(buf), digest,
+ if (router_append_dirobj_signature(buf, sizeof(buf), digest, DIGEST_LEN,
legacy_signing_key)) {
log_warn(LD_BUG, "Couldn't sign consensus networkstatus.");
return NULL; /* This leaks, but it should never happen. */