[or-cvs] [tor/master] Count unknown authorities as unknown only once, not once per signature.

nickm at torproject.org nickm at torproject.org
Tue Sep 21 04:04:12 UTC 2010


Author: Nick Mathewson <nickm at torproject.org>
Date: Mon, 20 Sep 2010 13:33:57 -0400
Subject: Count unknown authorities as unknown only once, not once per signature.
Commit: 1411842933afba657599dd1cccbc61040dfe9b4b

Do not double-report signatures from unrecognized authorities both as
"from unknown authority" and "not present".  Fixes bug 1956, bugfix on
0.2.2.16-alpha.
---
 changes/bug1956        |    5 +++++
 src/or/networkstatus.c |    8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 changes/bug1956

diff --git a/changes/bug1956 b/changes/bug1956
new file mode 100644
index 0000000..3e402b7
--- /dev/null
+++ b/changes/bug1956
@@ -0,0 +1,5 @@
+  o Minor bugfixes
+    - Do not double-report signatures from unrecognized authorities both
+      as "from unknown authority" and "not present".  Fixes bug 1956,
+      bugfix on 0.2.2.16-alpha.
+
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 9bb5546..1d8a20b 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -482,6 +482,7 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus,
                           voter) {
     int good_here = 0;
     int bad_here = 0;
+    int unknown_here = 0;
     int missing_key_here = 0, dl_failed_key_here = 0;
     SMARTLIST_FOREACH_BEGIN(voter->sigs, document_signature_t *, sig) {
       if (!sig->good_signature && !sig->bad_signature &&
@@ -497,7 +498,7 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus,
 
         if (!is_v3_auth) {
           smartlist_add(unrecognized, voter);
-          ++n_unknown;
+          ++unknown_here;
           continue;
         } else if (!cert || cert->expires < now) {
           smartlist_add(need_certs_from, voter);
@@ -527,8 +528,11 @@ networkstatus_check_consensus_signature(networkstatus_t *consensus,
       ++n_missing_key;
       if (dl_failed_key_here)
         ++n_dl_failed_key;
-    } else
+    } else if (unknown_here) {
+      ++n_unknown;
+    } else {
       ++n_no_signature;
+    }
   } SMARTLIST_FOREACH_END(voter);
 
   /* Now see whether we're missing any voters entirely. */
-- 
1.7.1



More information about the tor-commits mailing list