summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
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
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
2016-12-07Increase tolerances in util/monotonic_time testsNick Mathewson
This is an attempt to fix #19974.
2016-12-03Move a comment in test_single_onion_poisoningteor
2016-12-03Add a missing return value check in test_single_onion_poisoningteor
2016-12-03Remove a double-free in test_single_onion_poisoningteor
We were freeing both dir{1,2} directly, and service_{1,2}->directory via rend_service_free, even though they are the same pointer.
2016-12-03Refactor poison_dir allocation and free in test_single_onion_poisoningteor
This pattern is much less error-prone when future changes are made.
2016-12-02test_single_onion_poisoning: Free dir[12] on all pathsNick Mathewson
Coverity doesn't like it when there are paths to the end of the function where something doesn't get freed, even when those paths are only reachable on unit test failure. Fixes CID 1372899 and CID 1372900. Bug not in any released Tor.
2016-12-01Merge branch 'bug20638_029_v2_squashed' into maint-0.2.9Nick Mathewson
2016-12-01Stop ignoring hidden service key anonymity when first starting torteor
Instead, refuse to start tor if any hidden service key has been used in a different hidden service anonymity mode. Fixes bug 20638; bugfix on 17178 in 0.2.9.3-alpha; reported by ahf. The original single onion service poisoning code checked poisoning state in options_validate, and poisoned in options_act. This was problematic, because the global array of hidden services had not been populated in options_validate (and there were ordrering issues with hidden service directory creation). This patch fixes this issue in rend_service_check_dir_and_add, which: * creates the directory, or checks permissions on an existing directory, then * checks the poisoning state of the directory, then * poisons the directory. When validating, only the permissions checks and the poisoning state checks are perfomed (the directory is not modified).
2016-12-01Update unit tests for 20484, 20529teor
Add extra logging and extra validity checks for hidden services.
2016-11-21Merge remote-tracking branch 'arma/bug20423' into maint-0.2.9Nick Mathewson
2016-11-16refactor router_pick_published_address to have another argRoger Dingledine
no change in behavior except fewer log entries in the case where we use a cached result.
2016-11-16fixup! Add expect_log_msg_containing_either3() and ↵teor
expect_log_msg_containing_either4() Fix typos: * extra '(' * use assert_log_predicate (without 3 or 4 at the end) Tidy whitespace. Wrap long lines.
2016-11-16Add all four error messages to test_address_get_if_addrs6_list_no_internal()Neel Chauhan
2016-11-16Add all four error messages to test_address_get_if_addrs6_list_internal()Neel Chauhan
2016-11-16Add expect_log_msg_containing_either3() and expect_log_msg_containing_either4()Neel Chauhan
2016-11-08Merge remote-tracking branch 'public/bug20306_029' into maint-0.2.9Nick Mathewson
2016-11-07Merge remote-tracking branch 'teor/bug20484_029_v2' into maint-0.2.9Nick Mathewson
2016-11-07Fix another 20499-broken testNick Mathewson
2016-11-07Fix a unit test (broken by recent 20499 hacking)Nick Mathewson
2016-11-06In test_tortls_classify_client_ciphers(), s/ECDH/ECDHE/Nick Mathewson
(We weren't actually using these ciphers; we were just requing that ciphers of that name existed.) Patch from rubiate. Fixes 20460
2016-11-02Test single onion service configs where the directory does not existteor
Runs a test for each combination of create/don't create directories. Tests #20484.
2016-11-02Make sure passthrough_test_setup doesn't inadvertently fail or skip teststeor
passthrough_test_setup doesn't pass through arguments if the argument is equal to 0 or TT_SKIP. Instead, it fails or skips the test. Assert on this, so we don't accidentally fail or skip tests.
2016-11-02Add get_fname_rnd for unit tests that want a unique path every timeteor
2016-11-02Create get_fname_suffix, and refactor get_fname to use itteor
2016-11-02Use check_private_dir in test_single_onion_poisoningteor
This avoids Win32 conditionals for mkdir.
2016-11-01Attempt to fix unit tests on netbsdNick Mathewson
2016-10-31policy_is_reject_star():Nick Mathewson
ome policies are default-reject, some default-accept. But policy_is_reject_star() assumed they were all default_reject. Fix that! Also, document that policy_is_reject_star() treats a NULL policy as empty. This allows us to simplify the checks in parse_reachable_addresses() by quite a bit. Fxes bug 20306; bugfix on 0.2.8.2-alpha.
2016-10-14Whitespace cleaningNick Mathewson
2016-10-14Merge remote-tracking branch 'public/spaces_in_unix_addrs'Nick Mathewson
2016-10-14Make the FreeBSD ersatz_socketpair test even more skippable.Nick Mathewson
(This is safe, since only windows actually -uses- erstaz_socketpair.)
2016-10-13ersatz socketpair tests: work around freebsd jails.Nick Mathewson
2016-10-11Fix a bug in displaying IPv6 addrs in test_op_ipv6_ with --verboseNick Mathewson
The test code, if it failed, or if it was run in verbose mode, would use the wrong variable for its loop. Patch from rubiate uploaded to 19999.
2016-10-11torrc parsing b0rks on carriage-returnpaolo.ingls@gmail.com
(Specifically, carriage return after a quoted value in a config line. Fixes bug 19167; bugfix on 0.2.0.16-alpha when we introduced support for quoted values. Unit tests, changes file, and this parenthetical by nickm.)
2016-10-04Allow a unix: address to contain a C-style quoted string.Nick Mathewson
Feature 18753 -- all this to allow spaces.
2016-09-26Merge remote-tracking branch 'public/ticket20001_v2'Nick Mathewson
2016-09-26Merge branch 'protover_v2_squashed'Nick Mathewson
2016-09-26Rename compute_protover_vote to protover_compute_voteNick Mathewson
2016-09-26Clean whitespace, add missing documentationNick Mathewson
2016-09-26Cover the error cases of parsing protocol versionsNick Mathewson
Also, detect an additional failure type. Thanks, tests! (How distinctly I recall thee)