[or-cvs] [tor/master] network-status-version must come first in a vote/consensus

arma at torproject.org arma at torproject.org
Mon Feb 22 08:18:51 UTC 2010


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Mon, 22 Feb 2010 07:58:10 +0100
Subject: network-status-version must come first in a vote/consensus
Commit: 5aa9610dd6bc85574c9861d533daec16b74088a0

Spec conformance issue: The code didn't force the network-status-version
token to be the first token in a v3 vote or consensus.

Problem discovered by Parakeep.
---
 ChangeLog            |    3 +++
 src/or/routerparse.c |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2e75fc2..be7b30b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,9 @@ Changes in version 0.2.2.9-alpha - 2010-02-22
       control-spec.txt said they were.
     - Refactor resolve_my_address() to not use gethostbyname() anymore.
       Fixes bug 1244; bugfix on 0.0.2pre25. Reported by Mike Mestnik.
+    - Fix a spec conformance issue: the network-status-version token
+      must be the first token in a v3 consensus or vote. Discovered by
+      parakeep. Bugfix on 0.2.0.3-alpha.
 
   o Code simplifications and refactoring:
     - Generate our manpage and HTML documentation using Asciidoc. This
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 13dc10c..f4af7cd 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -430,7 +430,7 @@ static token_rule_t client_keys_token_table[] = {
 
 /** List of tokens allowed in V3 networkstatus votes. */
 static token_rule_t networkstatus_token_table[] = {
-  T1("network-status-version", K_NETWORK_STATUS_VERSION,
+  T1_START("network-status-version", K_NETWORK_STATUS_VERSION,
                                                    GE(1),       NO_OBJ ),
   T1("vote-status",            K_VOTE_STATUS,      GE(1),       NO_OBJ ),
   T1("published",              K_PUBLISHED,        CONCAT_ARGS, NO_OBJ ),
@@ -458,7 +458,7 @@ static token_rule_t networkstatus_token_table[] = {
 
 /** List of tokens allowed in V3 networkstatus consensuses. */
 static token_rule_t networkstatus_consensus_token_table[] = {
-  T1("network-status-version", K_NETWORK_STATUS_VERSION,
+  T1_START("network-status-version", K_NETWORK_STATUS_VERSION,
                                                    GE(1),       NO_OBJ ),
   T1("vote-status",            K_VOTE_STATUS,      GE(1),       NO_OBJ ),
   T1("valid-after",            K_VALID_AFTER,      CONCAT_ARGS, NO_OBJ ),
-- 
1.6.5



More information about the tor-commits mailing list