summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2018-08-18 16:54:09 +0000
committercypherpunks <cypherpunks@torproject.org>2018-09-12 02:47:29 +0000
commite9ef7d5ab42a8f896be92b9ed2c1818044b38f04 (patch)
treecaffea85eb0958e260cada21b7b0029edf8df4de
parentae1aea4cc490658e917b0c08584c7115a57da00b (diff)
downloadtor-e9ef7d5ab42a8f896be92b9ed2c1818044b38f04.tar.gz
tor-e9ef7d5ab42a8f896be92b9ed2c1818044b38f04.zip
test/protover: remove version zero from tests
This isn't legal according to dir-spec.txt. We can write separate tests for it if the spec is changed to make it legal.
-rw-r--r--src/test/test_protover.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/test/test_protover.c b/src/test/test_protover.c
index 0948cd5640..fb374c728b 100644
--- a/src/test/test_protover.c
+++ b/src/test/test_protover.c
@@ -290,13 +290,13 @@ test_protover_all_supported(void *arg)
tor_free(msg);
/* We shouldn't be able to DoS ourselves parsing a large range. */
- tt_assert(! protover_all_supported("Sleen=0-2147483648", &msg));
- tt_str_op(msg, OP_EQ, "Sleen=0-2147483648");
+ tt_assert(! protover_all_supported("Sleen=1-2147483648", &msg));
+ tt_str_op(msg, OP_EQ, "Sleen=1-2147483648");
tor_free(msg);
/* This case is allowed. */
- tt_assert(! protover_all_supported("Sleen=0-4294967294", &msg));
- tt_str_op(msg, OP_EQ, "Sleen=0-4294967294");
+ tt_assert(! protover_all_supported("Sleen=1-4294967294", &msg));
+ tt_str_op(msg, OP_EQ, "Sleen=1-4294967294");
tor_free(msg);
/* If we get a (barely) valid (but unsupported list, we say "yes, that's
@@ -313,7 +313,7 @@ test_protover_all_supported(void *arg)
/* If we get a completely unparseable list, protover_all_supported should
* hit a fatal assertion for BUG(entries == NULL). */
tor_capture_bugs_(1);
- tt_assert(protover_all_supported("Sleen=0-4294967295", &msg));
+ tt_assert(protover_all_supported("Sleen=1-4294967295", &msg));
tor_end_capture_bugs_();
/* Protocol name too long */
@@ -548,11 +548,11 @@ test_protover_vote_roundtrip(void *args)
{ "Zn=4294967295-1", NULL },
{ "Zn=4294967293-4294967295", NULL },
/* Will fail because of 4294967295. */
- { "Foo=1,3 Bar=3 Baz= Quux=9-12,14,15-16,900 Zn=0,4294967295",
+ { "Foo=1,3 Bar=3 Baz= Quux=9-12,14,15-16,900 Zn=1,4294967295",
NULL },
- { "Foo=1,3 Bar=3 Baz= Quux=9-12,14,15-16,900 Zn=0,4294967294",
- "Bar=3 Foo=1,3 Quux=9-12,14-16,900 Zn=0,4294967294" },
- { "Zu16=0,65536", "Zu16=0,65536" },
+ { "Foo=1,3 Bar=3 Baz= Quux=9-12,14,15-16,900 Zn=1,4294967294",
+ "Bar=3 Foo=1,3 Quux=9-12,14-16,900 Zn=1,4294967294" },
+ { "Zu16=1,65536", "Zu16=1,65536" },
{ "N-1=1,2", "N-1=1-2" },
{ "-1=4294967295", NULL },
{ "-1=3", "-1=3" },
@@ -581,9 +581,9 @@ test_protover_vote_roundtrip(void *args)
{ "Sleen=1-501", "Sleen=1-501" },
{ "Sleen=1-65537", NULL },
/* Both C/Rust implementations should be able to handle this mild DoS. */
- { "Sleen=0-2147483648", NULL },
+ { "Sleen=1-2147483648", NULL },
/* Rust tests are built in debug mode, so ints are bounds-checked. */
- { "Sleen=0-4294967295", NULL },
+ { "Sleen=1-4294967295", NULL },
};
unsigned u;
smartlist_t *votes = smartlist_new();