diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2009-09-13 21:47:55 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2009-09-14 22:06:21 +0200 |
commit | c1a6fb42ac08ab7ab729edca1837401d0f117fd1 (patch) | |
tree | f978a0fba54e4ed2420ac6e417cbfdfda5aaf972 /src/or/routerparse.c | |
parent | 3de5ac9baa7dc12f5bc441d75a8be48995e0f3a8 (diff) | |
download | tor-c1a6fb42ac08ab7ab729edca1837401d0f117fd1.tar.gz tor-c1a6fb42ac08ab7ab729edca1837401d0f117fd1.zip |
Fix a spec conformance issue when parsing a ns vote
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!
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 4137dd2812..aca559c00a 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) |