summaryrefslogtreecommitdiff
path: root/src/or/shared_random.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2016-05-24 13:56:39 +0300
committerDavid Goulet <dgoulet@torproject.org>2016-07-01 14:01:41 -0400
commitf6f4668b1d0dec1a9afc25ef9d7fcd884cc55608 (patch)
treebba407b7797dd7ad4874dd38170e32787198d023 /src/or/shared_random.c
parent5fe9a50c310b8af4c9447475ec9e3748b24984f0 (diff)
downloadtor-f6f4668b1d0dec1a9afc25ef9d7fcd884cc55608.tar.gz
tor-f6f4668b1d0dec1a9afc25ef9d7fcd884cc55608.zip
prop250: Don't reject votes containing commits of unknown dirauths.
Instead just ignore those commits. Squash this commit with 33b2ade.
Diffstat (limited to 'src/or/shared_random.c')
-rw-r--r--src/or/shared_random.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/or/shared_random.c b/src/or/shared_random.c
index 8427b680a7..7da6daf62f 100644
--- a/src/or/shared_random.c
+++ b/src/or/shared_random.c
@@ -599,6 +599,16 @@ should_keep_commit(const sr_commit_t *commit, const char *voter_key,
goto ignore;
}
+ /* Let's make sure, for extra safety, that this fingerprint is known to
+ * us. Even though this comes from a vote, doesn't hurt to be
+ * extracareful. */
+ if (trusteddirserver_get_by_v3_auth_digest(commit->rsa_identity) == NULL) {
+ log_warn(LD_DIR, "SR: Fingerprint %s is not from a recognized "
+ "authority. Discarding commit.",
+ escaped(commit->rsa_identity));
+ goto ignore;
+ }
+
/* Check if the authority that voted for <b>commit</b> has already posted
* a commit before. */
saved_commit = sr_state_get_commit(commit->rsa_identity);
@@ -1108,15 +1118,6 @@ sr_parse_commit(const smartlist_t *args)
escaped(rsa_identity_fpr));
goto error;
}
- /* Let's make sure, for extra safety, that this fingerprint is known to
- * us. Even though this comes from a vote, doesn't hurt to be
- * extracareful. */
- if (trusteddirserver_get_by_v3_auth_digest(digest) == NULL) {
- log_warn(LD_DIR, "SR: Fingerprint %s is not from a recognized "
- "authority. Discarding commit.",
- escaped(rsa_identity_fpr));
- goto error;
- }
/* Allocate commit since we have a valid identity now. */
commit = commit_new(digest);