summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-04 23:29:56 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-04 23:29:56 -0400
commit08efa70c41b258d8655ec01bdb721aea96b42d46 (patch)
tree3f02d0f047881c9f79591df82890db087f986793
parent7de3a19497f081e680e7fd35315f107510f313ad (diff)
parent9583a534ac8801211b6c171c399f1ea6bb3cce1c (diff)
downloadtor-08efa70c41b258d8655ec01bdb721aea96b42d46.tar.gz
tor-08efa70c41b258d8655ec01bdb721aea96b42d46.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
-rw-r--r--changes/warn-if-get_digest-fails6
-rw-r--r--src/or/dirserv.c5
-rw-r--r--src/or/dirvote.c8
3 files changed, 16 insertions, 3 deletions
diff --git a/changes/warn-if-get_digest-fails b/changes/warn-if-get_digest-fails
new file mode 100644
index 0000000000..6cfc1082a7
--- /dev/null
+++ b/changes/warn-if-get_digest-fails
@@ -0,0 +1,6 @@
+ o Minor bugfixes:
+ - If we fail to compute the identity digest of a v3 legacy
+ keypair, warn, and don't use a buffer-full of junk instead.
+ Bugfix on 0.2.1.1-alpha; fixes bug 3106.
+
+
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index bbd25da054..276f61c430 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2732,7 +2732,10 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
if (options->V3AuthUseLegacyKey) {
authority_cert_t *c = get_my_v3_legacy_cert();
if (c) {
- crypto_pk_get_digest(c->identity_key, voter->legacy_id_digest);
+ if (crypto_pk_get_digest(c->identity_key, voter->legacy_id_digest)) {
+ log_warn(LD_BUG, "Unable to compute digest of legacy v3 identity key");
+ memset(voter->legacy_id_digest, 0, DIGEST_LEN);
+ }
}
}
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 7ba6cca1b2..b90684c39a 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -3122,8 +3122,12 @@ dirvote_compute_consensuses(void)
authority_cert_t *cert = get_my_v3_legacy_cert();
legacy_sign = get_my_v3_legacy_signing_key();
if (cert) {
- crypto_pk_get_digest(cert->identity_key, legacy_dbuf);
- legacy_id_digest = legacy_dbuf;
+ if (crypto_pk_get_digest(cert->identity_key, legacy_dbuf)) {
+ log_warn(LD_BUG,
+ "Unable to compute digest of legacy v3 identity key");
+ } else {
+ legacy_id_digest = legacy_dbuf;
+ }
}
}