Commit Graph

4260 Commits

Author SHA1 Message Date
George Kadianakis cdd7e88970 Merge branch 'tor-github/pr/1261' 2019-09-05 17:02:53 +03:00
Neel Chauhan 0127888b06 Add tests for IPv6 exit policies on microdescriptors 2019-09-05 17:02:45 +03:00
Nick Mathewson c683896b7c Update routerset reset test to use new mgr API. 2019-09-04 08:42:34 -04:00
Nick Mathewson 17a870a64b Merge branch 'ticket31240v2_merged_2' into ticket31240v2_merged_2_merged 2019-09-04 08:41:42 -04:00
Nick Mathewson 1ef084c5fc test_confparse: verify that clearing a routerset sets it to NULL. 2019-08-28 12:28:17 -04:00
Nick Mathewson b1d7ddfb02 Merge branch 'ticket31240v2' into ticket31240v2_merged_2 2019-08-28 09:46:59 -04:00
Nick Mathewson a3e99c5f1e Add a test for clear_fn support in handling non-managed fields 2019-08-28 09:42:17 -04:00
Nick Mathewson c967b5c9ba Add a test for dumping a compound configuration 2019-08-28 09:42:17 -04:00
Nick Mathewson 8db3859cc6 Simple tests for nested configuration formats
One test makes sure that the toplevel magic numbers are distinct.

One test makes sure that we can parse a configuration object
with two sub-objects.
2019-08-28 09:42:17 -04:00
Nick Mathewson d9fe9f5ede Confmgr tests: test deprecations and abbreviations. 2019-08-28 09:42:17 -04:00
Nick Mathewson e4162cdb38 Start on test cases for the multi-object feature of confmgr.
This test case, at this point, only constructs the confmgr object.
More code to come.
2019-08-28 09:42:17 -04:00
Nick Mathewson cb5f8ace79 Tests for config_find_option_name()
Fix a bug in config_find_option_name() where it did not consider
the abbreviations table.
2019-08-28 09:42:17 -04:00
Nick Mathewson aa3f0c4788 Add tests for variable-listing functions.
This discovered a bug related to an extra & in
config_mgr_list_deprecated_vars(): fix that.
2019-08-28 09:42:17 -04:00
Nick Mathewson 38b770bbbb Make a config_suite_t type to hold multiple config sub-objects
Right now, it doesn't do anything; this patch is meant to make sure
that we're doing memory management correctly.
2019-08-28 09:40:53 -04:00
Nick Mathewson 47654d3249 Refactor config free logic to use a single path.
The right way to free a config object is now to wrap config_free(),
always.  Instead of creating an alternative free function, objects
should provide an alternative clear callback to free any fields that
the configuration manager doesn't manage.

This lets us simplify our code a little, and lets us extend the
confparse.c code to manage additional fields in config_free.
2019-08-28 09:40:53 -04:00
Nick Mathewson 3d1f9f583a Use special magic to enforce manager/object connection.
Every time we finalize a config manager, we now generate a new magic
number for it, so that we'll get an assertion failure if we ever try
to use an object with a different configuration manager than the one
that generated it.
2019-08-28 09:40:46 -04:00
George Kadianakis 78e084a12e Merge branch 'tor-github/pr/1267' 2019-08-27 11:47:46 +03:00
George Kadianakis 92a8573d22 Merge branch 'tor-github/pr/1258' 2019-08-27 11:45:18 +03:00
George Kadianakis 0d7f76d7ca Merge branch 'tor-github/pr/1234' 2019-08-27 11:44:13 +03:00
Nick Mathewson 8af92b6577 test_address: parenthesize macro arguments.
It's good style to always add parentheses when using macro
arguments, in case somebody someday provides an argument that
contains an operator you don't expect, or causes the expression to
parse differently.
2019-08-26 20:03:16 -04:00
Nick Mathewson 5eca338107 In tests, make sure that "ri" is freed on all paths.
In Tor's tests, the tt_*() macros can call "goto done" on failure.
When that happens, we need to make sure that all of our allocated
memory still gets freed, or else Coverity will complain.
2019-08-26 20:03:11 -04:00
Neel Chauhan c8e69e63f9 Add test for dirserv_router_has_valid_address() 2019-08-26 20:02:11 -04:00
David Goulet d819dfbded Merge branch 'tor-github/pr/1239' 2019-08-26 14:35:27 -04:00
Neel Chauhan 14654d5c97 Remove the unused circuit_type field from hs_ident_circuit_t and hs_ident_circuit_new() 2019-08-23 14:04:05 -04:00
Nick Mathewson 2780cbb9cb Merge branch 'ticket30935' into ticket30935_merged 2019-08-22 17:25:35 -04:00
teor 1ebff4d7f3 test/nodelist: Add unit tests for describe.c
Part of 21003.
2019-08-23 00:02:33 +10:00
Nick Mathewson edf5a327c5 Merge branch 'ticket30914' into ticket30914_merged 2019-08-20 13:57:05 -04:00
Nick Mathewson 0bf980705e Fix a memory-leak warning in test_circuitbuid.c
Coverity wants us to free everything that we are potentially
allocating, even stuff where allocating it would be a bug.  Adding
a smartlist_free() here will fix the warning.

Fixes bug 31452; bugfix on 16a0b7ed67, which is not in
any released Tor.  This is CID 1447292.
2019-08-19 16:21:55 -04:00
Nick Mathewson e7aabfce61 Merge remote-tracking branch 'tor-github/pr/1235' 2019-08-19 11:10:21 -04:00
George Kadianakis 4185ef29fd Merge branch 'tor-github/pr/1122' 2019-08-19 18:06:05 +03:00
George Kadianakis dfc8c0b536 Merge branch 'tor-github/pr/1214' 2019-08-19 18:04:35 +03:00
George Kadianakis 19e19c1fa8 Merge branch 'tor-github/pr/1154' 2019-08-19 18:03:51 +03:00
George Kadianakis b257e8e553 Merge remote-tracking branch 'mike/bug31356+logs-rebased2' into bug31356_final 2019-08-19 17:53:00 +03:00
David Goulet a8e6eab379 Merge branch 'tor-github/pr/1213' 2019-08-19 09:49:33 -04:00
teor 8a10c0696d test/nodelist: Fix a typo 2019-08-19 16:40:41 +10:00
Mike Perry b2821b72bc Bug 31356: Propogate protover padding support to circpad 2019-08-12 14:06:08 -05:00
Nick Mathewson 35cfe2e776 Merge remote-tracking branch 'tor-github/pr/1208' 2019-08-07 09:49:49 -04:00
Nick Mathewson 484b654048 test_token_bucket: negate after casting to signed type.
Previously we tried multiplying by -1 before casting to int32_t,
which would cause us to cast the -1 to an unsigned before we
multiplied.  This gave us compiler warnings on windows.

Fixes bug 31353; bug not in any released Tor.
2019-08-06 11:42:04 -04:00
Nick Mathewson 66437710af test_util: Do not check for ENETUNREACH unless it exists.
Fixes bug 31352; bug not in any released Tor.
2019-08-06 11:35:50 -04:00
David Goulet 90b5422e8e test: Series of fixes for hs_dos.c unit tests
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet c5b00c5a51 hs-v3: Add consensus parameters for DoS defenses
Part of #15516

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet fec0a7b7cb test: Add hs_dos.c unit tests
Currently test the only available function which is hs_dos_can_send_intro2()
within the HS anti-DoS subsystem.

Closes #15516

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet 9f738be893 hs: Limit the amount of relayed INTRODUCE2
This commit add the hs_dos.{c|h} file that has the purpose of having the
anti-DoS code for onion services.

At this commit, it only has one which is a function that decides if an
INTRODUCE2 can be sent on the given introduction service circuit (S<->IP)
using a simple token bucket.

The rate per second is 25 and allowed burst to 200.

Basic defenses on #15516.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
George Kadianakis d7afdb3b0f Merge branch 'tor-github/pr/1195' 2019-08-06 14:51:47 +03:00
George Kadianakis 8248812188 Rename handle_relay_command to handle_relay_cell_command .
As per David's review.
2019-08-05 18:03:23 +03:00
George Kadianakis 1e970d17b8 Test that regular cells get ignored in padding circuits. 2019-08-05 18:03:23 +03:00
Nick Mathewson fa60fee8d5 practracker: Add unit tests to test script, and test script to makefile
This makes all of the practracker tests get run by make check, and
hence by our CI.

Closes ticket 31304.
2019-08-01 14:01:43 -04:00
Nick Mathewson 2722296b95 Merge branch 'maint-0.4.1' 2019-07-25 20:11:47 -04:00
Nick Mathewson 278e65887b Fix more 32-bit errors with domain and tt_int_op 2019-07-25 20:11:33 -04:00
Nick Mathewson 69921a6a8a Merge branch 'maint-0.4.1' 2019-07-25 16:57:32 -04:00