Commit Graph

4347 Commits

Author SHA1 Message Date
teor 9be51e8a8e test/parseconf: Add tests for ignored options
These tests will also pass on 0.4.3, with the original implementation,
and with the new implementation in 32404.

Part of 32295 and 32404.
2019-11-12 10:09:40 +10:00
teor 5c8ecf364a Merge remote-tracking branch 'tor-github/pr/1354' into maint-0.4.2 2019-10-21 09:44:42 +10:00
teor cf2b00d3f5 test/rebind: Make control formatting and log parsing more robust
* actually sleep when tor has not logged anything
* log at debug level when waiting for tor to log something
* backslash-replace bad UTF-8 characters in logs
* format control messages as ASCII: tor does not accept UTF-8 control commands

Fixes bug 31837; bugfix on 0.3.5.1-alpha.
2019-10-20 20:09:35 +10:00
Nick Mathewson 0994050c4a Merge remote-tracking branch 'tor-github/pr/1426' into maint-0.4.2 2019-10-18 12:32:29 -04:00
Alexander Færøy 4ed06acb2a Add test to check if the exit callback is called in process_t upon process_exec() failures.
This patch adds a test to check for whether the exit callback is always
called when process_exec() fails, both on Windows and Unix.

See: https://bugs.torproject.org/31810
2019-10-17 20:52:32 +02:00
Nick Mathewson eebd2d44a1 Merge remote-tracking branch 'tor-github/pr/1393' into maint-0.4.2 2019-10-14 15:55:13 -04:00
Nick Mathewson ab064cf762 Merge remote-tracking branch 'tor-github/pr/1399' 2019-10-09 16:37:47 -04:00
Neel Chauhan 7c1b2fceb7 test: New behavior on IP retry for HSv3
Unit test for #31652 where if we are over the retry limit for the IP but we
have an established circuit, we don't remove the IP.

Part of #31652
2019-10-08 17:02:47 -04:00
David Goulet f50de3a918 hs-v3: Do not remove intro point if circuit exists
When considering introduction point of a service's descriptor, do not remove
an intro point that has an established or pending circuit.

Fixes #31652

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-08 17:02:47 -04:00
George Kadianakis 081bd37315 Fix flapping of test_service_intro_point() unittest. 2019-10-08 19:00:43 +03:00
Nick Mathewson 7a26f14a37 Merge remote-tracking branch 'tor-github/pr/1317' 2019-10-07 10:23:44 -04:00
Nick Mathewson fdfb4b196b Use {mock,unmock}_hostname_resolver() in relevant tests
These tests all invoke the hostname resolver in one way or another,
and therefore potentially block if our DNS server is missing,
absent, or extremely slow.  Closes ticket 31841.
2019-10-04 08:03:19 -04:00
Nick Mathewson 4a0749596c Add a mock replacement for blocking hostname resolution
Based on examination of our tests, this mock function accepts
"localhost" and "torproject.org", and rejects everything else.
2019-10-04 08:03:19 -04:00
teor e5b8bd38ab Merge remote-tracking branch 'tor-github/pr/1392' 2019-10-04 11:26:43 +10:00
David Goulet 52b7ae71b3 hs: ADD_ONION NEW:BEST now defaults to ED25519-V3
From RSA1024 (v2) to v3 now.

Closes #29669

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-03 15:43:03 -04:00
George Kadianakis 9309eaf8ea Merge branch 'tor-github/pr/1377' 2019-10-03 19:13:57 +03:00
George Kadianakis 3778b97cab Merge branch 'tor-github/pr/1276' 2019-10-03 19:13:02 +03:00
Nick Mathewson 49d6990cae Unit tests for dirserv_reject_tor_version(). 2019-10-03 19:12:52 +03:00
Nick Mathewson b2802ae3c3 util/map_anon_nofork: Add a cast to avoid passing -48 to memset
This fixes coverity CID 1454593, and bug 31948. Bug not in any
released version of Tor.
2019-10-03 07:21:25 -04:00
Nick Mathewson bca30bcb90 Merge remote-tracking branch 'tor-github/pr/1374' 2019-10-02 19:19:11 -04:00
David Goulet ca1f18c159 Merge branch 'tor-github/pr/1385' 2019-10-02 14:15:31 -04:00
Nick Mathewson 34bbdaf5d4 Add a test for max_u16_in_sl().
This test does not currently pass, because of bug 31898.
2019-10-01 13:01:20 -04:00
Nick Mathewson 53116ca0b7 Re-run "make autostyle" with improved annotate_ifdef_directives 2019-09-30 08:57:37 -04:00
teor db329522ef log: When initialising log domain masks, only set known log domains
And add a runtime test that checks for unknown domains and flags.

Fixes bug 31854; bugfix on 0.2.1.1-alpha.
2019-09-30 22:05:00 +10:00
George Kadianakis fc760c5088 Merge branch 'tor-github/pr/1356' 2019-09-30 13:47:06 +03:00
teor 2420c8c936 test: Avoid a map_anon_nofork test failure on SunOS
This test failure happened due to a signed/unsigned integer
comparison.

This bug occurred on SunOS, it may also occur on other systems that
use signed char as the default. (And cast 1-byte integer constants
to an unsigned integer.)

Fixes bug 31897; bugfix on 0.4.1.1-alpha.
2019-09-30 14:54:56 +10:00
Nick Mathewson ffd857bbe1 Merge remote-tracking branch 'tor-github/pr/1308' 2019-09-26 14:36:37 -04:00
Nick Mathewson 40a22fb707 Merge remote-tracking branch 'tor-github/pr/1349' 2019-09-25 13:07:19 -04:00
George Kadianakis 2199629648 Merge branch 'tor-github/pr/1345' 2019-09-25 14:14:30 +03:00
George Kadianakis 99f75373de Merge branch 'tor-github/pr/1309' 2019-09-25 14:12:42 +03:00
teor d30a042fa8 test: Use SEVERITY_MASK_IDX() to find the LOG_* mask indexes
In the unit tests and fuzzers.

Fixes bug 31334; bugfix on 0.2.5.2-alpha.
2019-09-25 16:40:09 +10:00
teor 83fa962c1a test: a file with no config options, at the end of an %include directory
(The file must contain whitespace or comments to trigger the bug.)

Regression test for 31408.
2019-09-24 11:10:50 +10:00
teor 876b3e2775 Merge branch 'bug31408_035' into bug31408_master 2019-09-24 11:07:38 +10:00
AmreshVenugopal 3e45260594 fix: Ticket #31589
- The function `decrypt_desc_layer` has a cleaner interface.
- `is_superencrypted_layer` changed from `int` -> `bool`

[ticket details](https://trac.torproject.org/projects/tor/ticket/31589)

add(changes/*): changes file
fix(src/features/hs): is_superencrypted changed from `int` -> `bool`
fix(changes/ticket31589): header
add(changes/ticket31589): subsystem(onion services) to change
2019-09-23 23:52:01 +05:30
Daniel Pinto 15490816da Fix bug when %including folder with comment only files. #31408
When processing a %included folder, a bug caused the pointer to
the last element of the options list to be set to NULL when
processing a file with only comments or whitepace. This could
cause options from other files on the same folder to be
discarded depending on the lines after the affected %include.
2019-09-23 10:39:08 +10:00
teor 69a1f9c8a7 test: test dirserv_router_has_valid_address() with DirAllowPrivateAddresses
Part of 31793.
2019-09-19 16:19:19 +10:00
teor c2ceede376 test: refactor dirserv_router_has_valid_address() tests
Cleanup after 31793.
2019-09-19 16:19:16 +10:00
teor 46fea1dfee test: dirserv_router_has_valid_address() with zero-family addresses
Sometimes tor doesn't initialise an address, so its family is zero.

Failing test for 31793. Future commits will fix the code.
2019-09-19 16:19:04 +10:00
Nick Mathewson 5f00c03ed0 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-09-17 21:28:38 -04:00
Nick Mathewson 9e674d0eb4 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-09-17 21:28:37 -04:00
Nick Mathewson 68a0106bf3 Run "make autostyle" and fix wide lines. 2019-09-16 13:27:42 -04:00
Nick Mathewson 8ad419744f On windows, allow failures in test_parseconf.sh
There seems to be some unreliability issue with this test on
appveyor.

Addresses ticket 31757; This isn't a final fix for this issue, but
it should make CI pass.
2019-09-16 11:01:03 -04:00
Nick Mathewson a1694b7363 Fix a shellcheck warning in test_parseconf.sh.
I wonder why this didn't show up before.
2019-09-16 09:22:43 -04:00
George Kadianakis cd72850e08 Merge branch 'tor-github/pr/1316' 2019-09-16 15:22:18 +03:00
George Kadianakis 5ec751b38b Merge branch 'tor-github/pr/1324' 2019-09-16 15:21:28 +03:00
Nick Mathewson 11cf4d9c3a test_parseconf.sh: On --dump-config failure, --verify-config 2019-09-14 19:00:41 -04:00
Nick Mathewson 7e9ee3a58d Add a test with many non-default options. 2019-09-14 19:00:41 -04:00
Nick Mathewson 617679df42 Add a few error test cases 2019-09-14 19:00:41 -04:00
Nick Mathewson 80e858e3e6 Add an integration test for %include. 2019-09-14 19:00:41 -04:00
Nick Mathewson 28025698a1 test_parseconf: run each test from inside its directory.
We need this to test includes and relative paths.
2019-09-14 19:00:41 -04:00