summaryrefslogtreecommitdiff
path: root/src/test/test_protover.c
AgeCommit message (Collapse)Author
2021-02-08Remove DirCache=1 from list of supported versions.Nick Mathewson
Closes #40221
2020-10-14Protover: simplify implementation structure to use 64-bit propertyNick Mathewson
Now that prop318 is in, we can simplify our representation for protocol range sets to just be a bitmask.
2020-10-14Merge branch 'prop318_limit_protover_035' into prop318_limit_protover_045Nick Mathewson
2020-10-14Implement proposal 318: Limit protovers to 0..63Nick Mathewson
In brief: we go through a lot of gymnastics to handle huge protover numbers, but after years of development we're not even close to 10 for any of our current versions. We also have a convenient workaround available in case we ever run out of protocols: if (for example) we someday need Link=64, we can just add Link2=0 or something. This patch is a minimal patch to change tor's behavior; it doesn't take advantage of the new restrictions. Implements #40133 and proposal 318.
2020-08-03Merge remote-tracking branch 'tor-gitlab/mr/94'Nick Mathewson
2020-06-24Merge branch 'tor-github/pr/1939'George Kadianakis
2020-06-24Make summarize_protover_flags() handle NULL and empty string the sameNeel Chauhan
2020-06-23Merge branch 'maint-0.4.4'David Goulet
2020-06-17Spelling fix: "RECCOMEND" => "RECOMMEND".Nick Mathewson
2020-05-18test/protover: Add debug logs to some teststeor
Part of 33222.
2020-05-17test/protover: Add tests for summarize flagsteor
Part of 33222.
2020-05-15protover: Add defines for recent protocol versionsteor
Also update the protover/supported_protocols test. Part of 33226.
2020-03-06Disable parts of test_protover_all_supported() that cause fatal exceptions ↵rl1987
when ALL_BUGS_ARE_FATAL
2020-02-12test/protover: Test hard-coded protover sortingteor
Make sure that the following hard-coded protocol version lists are sorted: * supported protocols * recommended relay and client protocols * required relay and client protocols This test currently fails, because the supported protocols are not sorted. Tests for 33285.
2020-02-09protover: reject unexpected commascypherpunks
Consistently reject extra commas, instead of only rejecting leading commas. Fix on b2b2e1c7f24d9b65059e3d089768d6c49ba4f58f. Fixes #27194; bugfix on 0.2.9.4-alpha.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-06-05Run "make autostyle."Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-10-23Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2018-10-23Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-23Merge remote-tracking branch 'onionk/rust-allsupportednull1' into maint-0.3.3Nick Mathewson
2018-09-21Merge branch 'maint-0.3.4'Nick Mathewson
2018-09-21Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-21Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-09-21Merge branch 'maint-0.2.9' into maint-0.3.2maint-0.3.2Nick Mathewson
2018-09-21rust/protover: fix null deref in protover_all_supported()cypherpunks
Fortunately with the current callers it couldn't happen in practice. Fix on d1820c1516a31a149fc51a9e5126bf899e4c4e08.
2018-09-16Add tortls.h includes to expose critical macro. Fix #27734.Nick Mathewson
2018-09-16When Tor is compiled with NSS, don't claim support for LinkAuth=1Nick Mathewson
Closes ticket 27288
2018-09-14protover: reject invalid protocol namescypherpunks
The spec only allows the characters [A-Za-z0-9-]. Fix on b2b2e1c7f24d9b65059e3d089768d6c49ba4f58f. Fixes #27316; bugfix on 0.2.9.4-alpha.
2018-09-12Merge branch 'maint-0.3.4'Nick Mathewson
2018-09-12Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-12test/protover: remove version zero from testscypherpunks
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.
2018-09-11Merge remote-tracking branch 'onionk/doublevote1'Nick Mathewson
2018-08-28Merge remote-tracking branch 'onionk/prototest1'Nick Mathewson
2018-08-19test/protover: add double-voting testcypherpunks
2018-08-17test/protover: add test for whitespace parsing bugcypherpunks
2018-08-17test/protover: add test for hyphen parsing bugcypherpunks
2018-07-05Whoops. Protover.[ch] belong in src/core/orNick Mathewson
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-05-22Merge branch 'maint-0.3.3'Nick Mathewson
2018-05-22Make the TROVE-2018-005 fix work with rust.Nick Mathewson
2018-05-22fix wide linesNick Mathewson
2018-05-22protover: TROVE-2018-005 Fix potential DoS in protover protocol parsing.Isis Lovecruft
In protover.c, the `expand_protocol_list()` function expands a `smartlist_t` of `proto_entry_t`s to their protocol name concatenated with each version number. For example, given a `proto_entry_t` like so: proto_entry_t *proto = tor_malloc(sizeof(proto_entry_t)); proto_range_t *range = tor_malloc_zero(sizeof(proto_range_t)); proto->name = tor_strdup("DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa"); proto->ranges = smartlist_new(); range->low = 1; range->high = 65536; smartlist_add(proto->ranges, range); (Where `[19KB]` is roughly 19KB of `"a"` bytes.) This would expand in `expand_protocol_list()` to a `smartlist_t` containing 65536 copies of the string, e.g.: "DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa=1" "DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa=2" […] "DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa=65535" Thus constituting a potential resource exhaustion attack. The Rust implementation is not subject to this attack, because it instead expands the above string into a `HashMap<String, HashSet<u32>` prior to #24031, and a `HashMap<UnvalidatedProtocol, ProtoSet>` after). Neither Rust version is subject to this attack, because it only stores the `String` once per protocol. (Although a related, but apparently of too minor impact to be usable, DoS bug has been fixed in #24031. [0]) [0]: https://bugs.torproject.org/24031 * ADDS hard limit on protocol name lengths in protover.c and checks in parse_single_entry() and expand_protocol_list(). * ADDS tests to ensure the bug is caught. * FIXES #25517: https://bugs.torproject.org/25517
2018-05-22Merge branch 'trove-2018-005_032' into trove-2018-005_033Nick Mathewson
2018-05-22protover: TROVE-2018-005 Fix potential DoS in protover protocol parsing.Isis Lovecruft
In protover.c, the `expand_protocol_list()` function expands a `smartlist_t` of `proto_entry_t`s to their protocol name concatenated with each version number. For example, given a `proto_entry_t` like so: proto_entry_t *proto = tor_malloc(sizeof(proto_entry_t)); proto_range_t *range = tor_malloc_zero(sizeof(proto_range_t)); proto->name = tor_strdup("DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa"); proto->ranges = smartlist_new(); range->low = 1; range->high = 65536; smartlist_add(proto->ranges, range); (Where `[19KB]` is roughly 19KB of `"a"` bytes.) This would expand in `expand_protocol_list()` to a `smartlist_t` containing 65536 copies of the string, e.g.: "DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa=1" "DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa=2" […] "DoSaaaaaaaaaaaaaaaaaaaaaa[19KB]aaa=65535" Thus constituting a potential resource exhaustion attack. The Rust implementation is not subject to this attack, because it instead expands the above string into a `HashMap<String, HashSet<u32>` prior to #24031, and a `HashMap<UnvalidatedProtocol, ProtoSet>` after). Neither Rust version is subject to this attack, because it only stores the `String` once per protocol. (Although a related, but apparently of too minor impact to be usable, DoS bug has been fixed in #24031. [0]) [0]: https://bugs.torproject.org/24031 * ADDS hard limit on protocol name lengths in protover.c and checks in parse_single_entry() and expand_protocol_list(). * ADDS tests to ensure the bug is caught. * FIXES #25517: https://bugs.torproject.org/25517
2018-04-02tests: Run all existing protover tests in both languages.Isis Lovecruft
There's now no difference in these tests w.r.t. the C or Rust: both fail miserably (well, Rust fails with nice descriptive errors, and C gives you a traceback, because, well, C).