summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2018-03-01Protover tests: disable some obsoleted testsNick Mathewson
These were meant to demonstrate old behavior, or old rust behavior. One of them _should_ work in Rust, but won't because of implementation details. We'll fix that up later.
2018-03-01Forbid UINT32_MAX as a protocol versionNick Mathewson
The C code and the rust code had different separate integer overflow bugs here. That suggests that we're better off just forbidding this pathological case. Also, add tests for expected behavior on receiving a bad protocol list in a consensus. Fixes another part of 25249.
2018-03-01Forbid "-0" as a protocol version.Nick Mathewson
Fixes part of 24249; bugfix on 0.2.9.4-alpha.
2018-03-01Add more of Teor's protover tests.Nick Mathewson
These are as Teor wrote them; I've disabled the ones that don't pass yet, with XXXX comments.
2018-03-01Add some protover vote round-trip tests from Teor.Nick Mathewson
I've refactored these to be a separate function, to avoid tricky merge conflicts. Some of these are disabled with "XXXX" comments; they should get fixed moving forward.
2018-02-09test: DoS test to make sure we exclude known relaysDavid Goulet
Part of #25193 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-08Merge branch 'ticket25183_029_01' into ticket24902_029_05David Goulet
2018-02-08test: Add unit tests for addressset.cDavid Goulet
This also adds one that tests the integration with the nodelist. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-06remove a redundant semicolonNick Mathewson
2018-02-02Use tt_u64_op() for uint64_t inputs.Nick Mathewson
2018-02-02Merge branch 'ticket25122_029_02' into ticket24902_029_05David Goulet
2018-02-02geoip: Hook the client history cache into the OOM handlerDavid Goulet
If the cache is using 20% of our maximum allowed memory, clean 10% of it. Same behavior as the HS descriptor cache. Closes #25122 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31test: Add unit tests for overflows and underflows in cc_stats_refill_bucketteor
Closes #25094. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31dos: Make sure cc_stats_refill_bucket can't overflow while calculatingteor
Debug log the elapsed time in cc_stats_refill_bucket Part of #25094. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31test: Remove a redundant round from test_dos_bucket_refillteor
This round is left over from the tenths of a second code. Part of #25094.
2018-01-30test: Add unit tests for the DoS subsystemGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-21Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-12-21Merge branch 'maint-0.2.5' into maint-0.2.8maint-0.2.8Nick Mathewson
2017-12-21Move free to end of test function so coverity won't complain.Nick Mathewson
2017-12-21Move destroy cells into a separate queue type of their own, to save RAMNick Mathewson
We've been seeing problems with destroy cells queues taking up a huge amount of RAM. We can mitigate this, since while a full packed destroy cell takes 514 bytes, we only need 5 bytes to remember a circuit ID and a reason. Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues were introduced.
2017-11-13Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-11-13Merge branch 'bug23291_028' into maint-0.2.8Nick Mathewson
2017-10-23Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-10-23Adjust test, now that there are 9 dirauths againNick Mathewson
2017-09-12Avoid sscanf() warnings from openbsd in the unit testsNick Mathewson
OpenBSD doesn't like tricks where you use a too-wide sscanf argument for a too-narrow array, even when you know the input string statically. The fix here is just to use bigger buffers. Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
2017-08-2122839: fix check_heap_buffer buffer size in test-memwipeTies Stuij
2017-08-01Merge remote-tracking branch 'public/bug19769_19025_029' into maint-0.2.9Nick Mathewson
2017-07-14Merge branch 'bug22916_027' into maint-0.2.9Nick Mathewson
2017-07-13Fix compiler warnings with openssl-scrypt/libscrypt test on clangNick Mathewson
Clang didn't like that we were passing uint64_t values to an API that wanted uint32_t. GCC has either not cared, or has figured out that the values in question were safe to cast to uint32_t. Fixes bug22916; bugfix on 0.2.7.2-alpha.
2017-07-07Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-07-07mingw fix: avoid "unused var" warning.Nick Mathewson
This is a backport of 19615bce64cd381a925bc3910120ac39ca918e7c to fix bug 22838.
2017-07-05Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-07-05Merge branch 'maint-0.2.7-redux' into maint-0.2.8Nick Mathewson
2017-07-05Merge branch 'maint-0.2.6' into maint-0.2.7-reduxNick Mathewson
2017-07-05Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-07-05Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-07-03Fix assertion failure related to openbsd strtol().Nick Mathewson
Fixes bug 22789; bugfix on 0.2.3.8-alpha.
2017-06-05Rename "link" variable to avoid shadowing warning.Nick Mathewson
2017-06-05Repair link_handshake unit tests to mock tor_tls_get_own_cert()Nick Mathewson
The tests previously assumed that the link handshake code would be calling get_my_certs() -- when I changed it to call get_own_cert() instead for the (case 2) 22460 fix, the tests failed, since the tls connection wasn't really there. This change makes us start mocking out the tor_tls_get_own_cert() function too. It also corrects the behavior of the mock_get_peer_cert() function -- it should have been returning a newly allocated copy.
2017-02-14Fix policies.c instance of the "if (r=(a-b)) return r" patternNick Mathewson
I think this one probably can't underflow, since the input ranges are small. But let's not tempt fate. This patch also replaces the "cmp" functions here with just "eq" functions, since nothing actually checked for anything besides 0 and nonzero. Related to 21278.
2017-02-07Merge branch 'teor_bug21357-v2_029' into maint-0.2.9Nick Mathewson
2017-02-01Support LibreSSL with opaque structuresrubiate
Determining if OpenSSL structures are opaque now uses an autoconf check instead of comparing the version number. Some definitions have been moved to their own check as assumptions which were true for OpenSSL with opaque structures did not hold for LibreSSL. Closes ticket 21359.
2017-02-01Scale IPv6 address counts in policy_summary_reject to avoid overflowteor
This disregards anything smaller than an IPv6 /64, and rejects ports that are rejected on an IPv6 /16 or larger. Adjust existing unit tests, and add more to cover exceptional cases. No IPv4 behaviour changes. Fixes bug 21357
2017-02-01Add unit tests for IPv6 address summaries and IPv4 netblock rejectionteor
These tests currently fail due to bug 21357
2017-01-18test_cfmt_connected_cells: use TTL value that's above the new min.Nick Mathewson
Related to 19769.
2017-01-18DefecTor countermeasure: change server- and client-side DNS TTL clippingNick Mathewson
The server-side clipping now clamps to one of two values, both for what to report, and how long to cache. Additionally, we move some defines to dns.h, and give them better names.
2016-12-09test: fix memory leak in single onion poisoningDavid Goulet
Closes #20938 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-08Use the correct preprocessor macro for Linuxcypherpunks
Also combine all of the checks into one if-tree as only one of them should actually succeed.
2016-12-07Netbsd doesn't have ipfw, only the regular pf transport stuff.Nick Mathewson
Attempted fix for 19960. Also, fixes a typo.
2016-12-07Increase verbosity on options/validate__transproxyNick Mathewson
This is an attempt to figure out what's up with #19960