Commit Graph

34122 Commits

Author SHA1 Message Date
teor
1d4d2deea1 config: Move dirauth stats actions into the module
This commit:
* moves dirauth stats and mtbf config actions into dirauth_config,
* adds thin wrappers to make the moved code compile.

The moved code is disabled when the dirauth module is disabled.

Part of 32213.
2019-10-31 12:34:20 +10:00
teor
fc5da4ad04 config: Move relay config actions into the relay module
This commit:
* moves relay config actions into relay_config,
* moves get_dirportfrontpage() into relay_config,
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the relay module is disabled. (Some of the checks
are re-ordered, so the order of some warnings may change.)

Part of 32213.
2019-10-31 12:34:20 +10:00
teor
6d03c05665 config: Move server transport actions into the relay module
This commit:
* moves server transport config checks into transport_config.c,
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the relay module is disabled. (Some of the checks
are re-ordered, so the order of some warnings may change.)

Part of 32213.
2019-10-31 12:34:20 +10:00
teor
0a511778eb config: Move bw & other configs into the dirauth module
This commit:
* moves bandwidth checks into dirauth_config, and
* moves some other minor checks into dirauth_config.

The moved code is disabled when the dirauth module is disabled.
(And some of the checks are re-ordered, so the order of some
warnings may change.)

Part of 32213.
2019-10-31 12:34:20 +10:00
teor
d5ca56e254 config: Move accounting/bandwidth config into the relay module
This commit:
* moves accounting and bandwidth checks into relay_config,
* moves testing options checks into relay_config,
* moves some other minor checks into relay_config,
* exposes some code from src/app/config.c
  (we'll refactor it later in 29211), and
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the relay module is disabled. (Some of the checks
are re-ordered, so the order of some warnings may change.)

Part of 32213.
2019-10-31 12:34:20 +10:00
teor
11f283f561 config: Move server transport config into the relay module
This commit:
* creates feature/relay/transport_config.[ch],
* moves server transport config checks into them,
* exposes some code from src/app/config.c
  (we'll refactor it later in 29211), and
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the relay module is disabled. (Some of the checks
are re-ordered, so the order of some warnings may change.)

Part of 32213.
2019-10-31 12:34:20 +10:00
teor
093a127c82 config: Move relay config checks into the relay module
This commit:
* moves relay config checks into relay_config.[ch],
* exposes some code from src/app/config.c
  (we'll refactor it later in 29211), and
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the relay module is disabled. (Some of the checks
are re-ordered, so the order of some warnings may change.)

Part of 32213.
2019-10-31 12:34:19 +10:00
teor
0722b4fdb9 config: Move relay port parsing into the relay module
This commit:
* creates feature/relay/relay_config.[ch],
* moves relay port parsing into them,
* exposes some code from src/app/config.c
  (we'll refactor it later in 29211), and
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the relay module is disabled.

Part of 32213.
2019-10-31 12:34:19 +10:00
teor
f70633d72d dirauth: Remove some outdated config comments
Part of 32213.
2019-10-31 12:34:19 +10:00
teor
3881ac2c86 dirauth: Refactor some config checks
Minor cleanup and simplification.

Part of 32213.
2019-10-31 12:34:19 +10:00
teor
da49c4d78d dirauth: Disable dirauth config when the module is disabled
Part of 32213.
2019-10-31 12:34:19 +10:00
teor
5950566f1d config: Move dirauth config into the dirauth module
This commit:
* creates feature/dirauth/dirauth_config.[ch],
* moves the dirauth config code into them,
* copies some macros from src/app/config.c
  (we'll refactor them later in 29211), and
* adds thin wrappers to make the moved code compile.

No functional changes: the moved code is still enabled,
even if the dirauth module is disabled.

Part of 32213.
2019-10-31 12:34:19 +10:00
teor
40e75bc3e1
doc: Add defaults for some transport options 2019-10-31 11:27:26 +10:00
teor
a18e84ad01
config: Improve some function comments 2019-10-31 11:11:51 +10:00
teor
4666ca73a1
config: Give warn_about_relative_paths() const args
Also gives make_path_absolute() const args.

Obviously correct fixes to already reviewed code.
2019-10-31 10:53:26 +10:00
Nick Mathewson
a6ad26fd5f Merge remote-tracking branch 'tor-github/pr/1485' 2019-10-30 16:16:12 -04:00
David Goulet
cfc60e566c circ: Add an handle to circuit_t
Closes #32343

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-30 16:12:56 -04:00
Nick Mathewson
5a1dfca071 Fix 32167: comment in config.c 2019-10-30 16:05:48 -04:00
Nick Mathewson
14831ea0ab Use FILENAME to determine which options to check for relative paths
This is part of ticket 32344.
2019-10-30 15:32:12 -04:00
Nick Mathewson
15371d801c Mark more torrc options as FILENAME rather than as STRING.
This will help us reimplement warn_about_relative_paths().

FILENAME options currently are the same as STRINGs in most respects,
except for the type reported to the controller.

In this commit, I'm picking the options to change based on:
  * the current contents of warn_about_relative_paths()
  * options that end with "File".
2019-10-30 15:14:05 -04:00
Nick Mathewson
b985cf2403 Use CFLG_IMMUTABLE to replace much of the options transition cb.
Closes ticket 32344.
2019-10-30 15:05:26 -04:00
Nick Mathewson
2a2c7049b8 Add a CFLG_IMMUTABLE flag to mark a field as unchangeable. 2019-10-30 15:00:53 -04:00
teor
183f9e490f
test: Fix a comment typo in src/test/test_hs_ntor.sh 2019-10-31 00:43:13 +10:00
teor
861b9366df
test: Fix a loop variable bug in test_parseconf.sh
Obviously correct fixes to already reviewed code.
No changes file required: not in any released version of tor.
2019-10-31 00:23:30 +10:00
David Goulet
f579541f13 Merge branch 'tor-github/pr/1468' 2019-10-30 08:53:51 -04:00
Neel Chauhan
f81e4aa831 hs-v2: Lookup intro failure cache when picking an intro from descriptor
When picking an intro point from the service descriptor, the client failed to
lookup the failure cache.

It made an HS v2 client re-pick bad intro points for which we already know it
won't work in the first place.

Based on Neel Chauhan original patch.

Fixes #25568

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-30 08:47:21 -04:00
teor
dce1f63d44
fs: Clarify an ambiguous comment about string/pointer equality 2019-10-30 16:15:43 +10:00
Taylor Yu
1e8ddbe1ee Changes file for ticket 32277 2019-10-29 16:39:03 -05:00
Taylor Yu
5e4ae73051 Reformat some options in tor.1.txt
Reformat command line options in tor.1.txt to display as fixed-width
in the HTML version.  Based on a patch by Swati Thacker.  Part of
ticket 32277.
2019-10-29 16:39:03 -05:00
Taylor Yu
8660a32d18 Reword command-options in tor.1.txt
Reword the COMMAND-LINE OPTIONS section of tor.1.txt.  Based on a
patch by Swati Thacker.  Part of ticket 32277.
2019-10-29 16:39:03 -05:00
Taylor Yu
90ba8bae3f Reword DESCRIPTION in tor.1.txt
Reword the DESCRIPTION section of tor.1.txt.

Based on a patch by Swati Thacker.  Part of ticket 32277.
2019-10-29 16:39:03 -05:00
Taylor Yu
4c38fccb9b Move command-line conf option description earlier
In tor.1.txt, move the paragraphs at the end of the COMMAND-LINE
OPTIONS section earlier.  This text describes how the user can specify
configuration options on the command line.

Also clarify some wording and formatting.

Based on a patch by Swati Thacker.  Part of ticket 32277.
2019-10-29 16:39:03 -05:00
George Kadianakis
4413b98190 Merge branch 'tor-github/pr/1456' 2019-10-29 21:29:13 +08:00
teor
30705e8294
app/config: Fix a comment typo in config.c
The options validation is now a callback.

Bugfix on 31241; not in any released version of tor.
2019-10-29 12:40:20 +10:00
teor
b448f6044d
Merge branch 'maint-0.4.2' 2019-10-29 08:27:02 +10:00
teor
2395800d3e
Merge branch 'maint-0.4.1' into maint-0.4.2 2019-10-29 08:26:55 +10:00
teor
63aff4a43e
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-29 08:26:48 +10:00
teor
54e2d0dc2d
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-29 08:26:40 +10:00
teor
15d67842f9
Merge branch 'maint-0.2.9' into maint-0.3.5 2019-10-29 08:26:32 +10:00
teor
752c35ca96
Merge remote-tracking branch 'tor-github/pr/1460' into maint-0.2.9 2019-10-29 08:23:35 +10:00
David Goulet
d67db64ced changes: Add file for ticket 32196
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:21:08 -04:00
David Goulet
ceca6e7c35 ewma: Implement unit tests
At this commit, 93.9% of line coverage and 95.5% of function coverage.

Closes #32196

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
48781c32ca ewma: Move private struct into header private section
Facilitate testing.

Part of #32196.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
bbcded554a test: Implement unit tests for circuitmux.c
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
dba249bc73 test: Add fakecircs.{h|c} helper
Fake circuits are created everywhere in the unit tests. This is an attempt at
centralizing a "fake circuit creation" API like fakechans.c does for channel.

This commit introduces fakecircs.c and changes test_relay.c and
test_circpadding.c which were using roughly the same code.

This will allow easier OR circuit creation for the future tests in
test_circuitmux.c

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
a41ec84914 test: Implement cmux allocate unit test
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
d2e51aca7d test: Remove circuitmux/destroy_cell_queue code duplication
This also rename a function to improve code clarity.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
839bc4814e test: Add testcase setup object for test_cmux
Also remove a scheduler_init() from a test and MOCK the appropriate function
so the test can pass.

This is done in order to minimize initialization functions in the unit test
and try to only go through the testcase setup object.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
7678022e85 cmux: Move circuitmux_s object into header in private section
Step needed in order to access members of the object for unit tests.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00
David Goulet
4c95022658 core: Add missing include in destroy_cell_queue_st.h
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28 13:17:11 -04:00