[or-cvs] [tor/master] Fix a spec conformance issue when parsing a ns vote

arma at seul.org arma at seul.org
Thu Sep 17 00:38:24 UTC 2009


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Sun, 13 Sep 2009 21:47:55 +0200
Subject: Fix a spec conformance issue when parsing a ns vote
Commit: c1a6fb42ac08ab7ab729edca1837401d0f117fd1

A vote may only contain exactly one signature. Make sure we reject
votes that violate this.

Problem found by Rotor, who also helped writing the patch. Thanks!
---
 ChangeLog            |    2 ++
 src/or/routerparse.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bfbbaa9..a3e19b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@ Changes in version 0.2.2.2-alpha - 2009-09-??
       Found by Matt Edman. Bugfix on 0.2.0.16-alpha.
     - Fix parsing for memory or time units given without a space between
       the number and the unit.  Bugfix on 0.2.2.1-alpha; fixes bug 1076.
+    - A networkstatus vote must contain exactly one signature. Spec
+      conformance issue. Bugfix on 0.2.0.3-alpha.
 
 
 Changes in version 0.2.2.1-alpha - 2009-08-26
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 4137dd2..aca559c 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2616,6 +2616,10 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
   if (! n_signatures) {
     log_warn(LD_DIR, "No signatures on networkstatus vote.");
     goto err;
+  } else if (ns->type == NS_TYPE_VOTE && n_signatures != 1) {
+    log_warn(LD_DIR, "Received more than one signature on a "
+             "network-status vote.");
+    goto err;
   }
 
   if (eos_out)
-- 
1.5.6.5



More information about the tor-commits mailing list