]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Enable ed25519 collator in voting.
authorNick Mathewson <nickm@torproject.org>
Mon, 22 Feb 2016 15:07:42 +0000 (10:07 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 22 Feb 2016 15:07:42 +0000 (10:07 -0500)
Previously, I had left in some debugging code with /*XXX*/ after it,
which nobody noticed.  Live and learn!  Next time I will use /*XXX
DO NOT COMMIT*/ or something.

We need to define a new consensus method for this; consensus method
21 shouldn't actually be used.

Fixes bug 17702; bugfix on 0.2.7.2-alpha.

changes/bug17702 [new file with mode: 0644]
src/or/dircollate.c
src/or/dirvote.c
src/or/dirvote.h

diff --git a/changes/bug17702 b/changes/bug17702
new file mode 100644 (file)
index 0000000..4fda36f
--- /dev/null
@@ -0,0 +1,6 @@
+  o Major bugfixes:
+    - Actually enable Ed25519-based directory collation.
+      Previously, the code had been written, but some debugging code that had
+      accidentally been left in the codebase made it stay turned off.
+      Fixes bug 17702; bugfix on 0.2.7.2-alpha.
+
index 4c812c40e65c407fdd723ca32acefbd4f37a4578..f56aea8c64f20c62cd300b9d1a1e0951264ac7ce 100644 (file)
@@ -159,7 +159,7 @@ dircollator_collate(dircollator_t *dc, int consensus_method)
   tor_assert(!dc->is_collated);
   dc->all_rsa_sha1_lst = smartlist_new();
 
-  if (consensus_method < MIN_METHOD_FOR_ED25519_ID_VOTING + 10/*XXX*/)
+  if (consensus_method < MIN_METHOD_FOR_ED25519_ID_VOTING)
     dircollator_collate_by_rsa(dc);
   else
     dircollator_collate_by_ed25519(dc);
index d8e6ee2229045f202ccd025b9c7b384b53d2cd00..be0635d92b9455c4036bf95a67eafc35a4d8a319 100644 (file)
@@ -558,6 +558,13 @@ compute_consensus_method(smartlist_t *votes)
 static int
 consensus_method_is_supported(int method)
 {
+  if (method == MIN_METHOD_FOR_ED25519_ID_IN_MD) {
+    /* This method was broken due to buggy code accidently left in
+     * dircollate.c; do not actually use it.
+     */
+    return 0;
+  }
+
   return (method >= MIN_SUPPORTED_CONSENSUS_METHOD) &&
     (method <= MAX_SUPPORTED_CONSENSUS_METHOD);
 }
index dca8540870d930402d4556ca9ea57e382e016b66..50c2496bb036b7cf8d71ff6decca16688fbb6ddf 100644 (file)
@@ -55,7 +55,7 @@
 #define MIN_SUPPORTED_CONSENSUS_METHOD 13
 
 /** The highest consensus method that we currently support. */
-#define MAX_SUPPORTED_CONSENSUS_METHOD 21
+#define MAX_SUPPORTED_CONSENSUS_METHOD 22
 
 /** Lowest consensus method where microdesc consensuses omit any entry
  * with no microdesc. */
 #define MIN_METHOD_FOR_GUARDFRACTION 20
 
 /** Lowest consensus method where authorities may include an "id" line for
- * ed25519 identities in microdescriptors. */
+ * ed25519 identities in microdescriptors. (Broken; see
+ * consensus_method_is_supported() for more info.) */
 #define MIN_METHOD_FOR_ED25519_ID_IN_MD 21
 /** Lowest consensus method where authorities vote on ed25519 ids and ensure
  * ed25519 id consistency. */
-#define MIN_METHOD_FOR_ED25519_ID_VOTING MIN_METHOD_FOR_ED25519_ID_IN_MD
+#define MIN_METHOD_FOR_ED25519_ID_VOTING 22
 
 /** Default bandwidth to clip unmeasured bandwidths to using method >=
  * MIN_METHOD_TO_CLIP_UNMEASURED_BW.  (This is not a consensus method; do not