Commit Graph

985 Commits

Author SHA1 Message Date
Nick Mathewson
87f7c2d018 Correct the type for config_decl_ROUTERSET
This needs to be a point so that the CONF_VAR() macro can work
correctly.
2019-12-19 10:42:10 -05:00
Nick Mathewson
3739503404 Move TestingMin{Exit,Fast}FlagThreshold to dirauth module. 2019-12-19 10:14:09 -05:00
Nick Mathewson
cde5abfdc6 Move TestingDirAuthTimeToLearnReachability into dirauth module. 2019-12-19 10:08:22 -05:00
Nick Mathewson
be9bc5981f Move MinMeasuredBWsForAuthToIgnoreAdvertised to dirauth module. 2019-12-19 09:51:11 -05:00
Nick Mathewson
0c7fd83123 Move ConsensusParams to dirauth module. 2019-12-19 09:46:14 -05:00
Nick Mathewson
77dea66e19 Move MinUptimeHidServDirectoryV2 to dirauth module. 2019-12-19 09:43:25 -05:00
Nick Mathewson
b1d029b9a1 Move AuthDirTestEd25519LinkKeys to the dirauth module. 2019-12-19 09:38:25 -05:00
Nick Mathewson
f4f70e1f13 Move AuthDirSharedRandomness to dirauth module. 2019-12-19 09:34:27 -05:00
Nick Mathewson
99874ecc1d Move AuthDirPinKeys to dirauth module. 2019-12-19 09:34:18 -05:00
Nick Mathewson
9386b0b28a Move AuthDirListBadExits to dirauth module. 2019-12-19 09:24:57 -05:00
Nick Mathewson
eedab30a7b Move AuthDirHasIPv6Connectivity into dirauth module. 2019-12-19 09:19:02 -05:00
Nick Mathewson
7d5e360c3b Move BW-guarantee options in to dirauth module. 2019-12-19 08:57:47 -05:00
Nick Mathewson
ea91edff15 Dirauth options: move versioning options to dirauth module
This commit moves VersioningAuthoritativeDirectory,
RecommendedClientVersions, and RecommendedServerVersions.
2019-12-19 08:57:47 -05:00
Nick Mathewson
a6ba56761b Merge branch 'dirauth_config_squashed' 2019-12-19 07:55:06 -05:00
Nick Mathewson
13df744921 Declare relay/dirauth subsystem levels in a header.
This way, we can't get out of sync between the two declarations.
2019-12-19 07:54:56 -05:00
Nick Mathewson
ffa3499d81 Add config object for dirauth; move one option there.
I've chosen the "AuthDirMaxServersPerAddr" option here for
simplicity, since it is used literally nowhere else besides the dirauth
module.  Once we have all the infrastructure in place for this, we
can move more options into this structure.
2019-12-19 07:54:56 -05:00
Nick Mathewson
5e2318165d Add "stub" files for disabled modules.
These modules are only built when the selected modules are disabled.
The provide stub implementations of the subsystem blocks.  Later,
other stub implementations could move here.

Having real subsystem blocks here will let us handle disabled
configuration options better.
2019-12-19 07:54:56 -05:00
George Kadianakis
b7304027f6 Merge branch 'tor-github/pr/1587' 2019-12-18 14:19:15 +02:00
teor
648399d6c2
Merge remote-tracking branch 'tor-github/pr/1505' 2019-12-16 08:15:19 +10:00
Neel Chauhan
a8b5b9a1bc In cancel_descriptor_fetches(), use connection_list_by_type_purpose() instead of connection_list_by_type_state() 2019-12-10 12:00:38 -05:00
George Kadianakis
a38014e5c6 Merge branch 'tor-github/pr/1581' 2019-12-10 18:34:00 +02:00
David Goulet
fc32349adc hs-v3: Handle client rendezvous circuit timeout
With v3, the "pending_final_cpath" of a circuit is always NULL which means
that for v3, established client rendezvous circuit waiting for the intro point
to ACK, will always end up timing out quickly.

This can increase the delays to which you connect to a service since in order
to succeed, the rendezvous circuit needs to fully established
(CIRCUIT_PURPOSE_C_REND_JOINED) within the cutoff of the introduction circuit
as well which is these days around 2-3 seconds.

Fixes #32021

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-12-10 18:33:48 +02:00
Taylor Yu
bfe38878b2 Rename control_reply_add_1kv
Part of ticket 30984.
2019-12-09 09:55:04 -06:00
Taylor Yu
9b196f1563 simplify getinfo using reply lines
Simplify handle_control_getinfo() by using the new reply lines
abstraction.  Previously, this function explicitly checked for whether
it should generate a MidReplyLine, a DataReplyLine, or an
EndReplyLine.  control_write_reply_lines() now abstracts this check.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
a08f43ba04 use control reply lines for protocolinfo
Simplify handle_control_protocolinfo() by using the new reply line
abstraction.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
2143bae6c4 refactor handle_control_protocolinfo
Factor out the parts of handle_control_protocolinfo() that assemble
the AUTHMETHODS and COOKIEFILE strings.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
c744d23c8d simplify getconf by using reply lines
In handle_control_getconf(), use the new control reply line
abstraction to simplify output generation.  Previously, this function
explicitly checked for whether it should generate a MidReplyLine or an
EndReplyLine.  control_write_reply_lines() now abstracts this check.

Part of #30984.
2019-12-08 22:40:00 -06:00
Taylor Yu
1a68a18093 reply lines structures
Part of #30984.
2019-12-08 22:40:00 -06:00
Nick Mathewson
fcb5656128 Merge branch 'ticket32609_squashed' 2019-12-04 12:15:28 -05:00
teor
9ad569c71d practracker: Add missing .may_include files
All of these files contain "*.h", except for:
* src/app/config/.may_include
* src/test/.may_include
which also contain "*.inc".

This change prevents includes of "*.c" files, and other
unusually named files.

Part of 32609.
2019-12-04 12:15:22 -05:00
George Kadianakis
2693bf47e8 control-port: Include HS address in ONION_CLIENT_AUTH_VIEW reply. 2019-12-04 13:33:07 +02:00
David Goulet
3b64c6b6fc hs-v3: Fix NULL deref. in hs_circ_service_get_established_intro_circ()
Found by Stem regression tests. Reported by atagar.

Fixes #32664

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-12-03 10:11:42 -05:00
David Goulet
65759f2901 Merge branch 'tor-github/pr/1563' 2019-12-03 09:22:21 -05:00
George Kadianakis
12305b6bb6 hsv3: ONION_CLIENT_AUTH_REMOVE now also removes the credential file. 2019-12-03 09:22:17 -05:00
George Kadianakis
8ed8707f0a hsv3: Abstract parts of hs_config_client_authorization() into func.
Now we have a function that reads a file and returns a credential. We need that
for the REMOVE control port command.
2019-12-03 09:22:17 -05:00
George Kadianakis
763f337290 hsv3: Start refactoring hs_config_client_authorization().
- Remove key_dir which is useless.
- Kill an indentation layer.

We want to make it cleaner and slimmer so that we can reuse parts of it in the
REMOVE command for removing the right client auth file.
2019-12-03 09:22:17 -05:00
George Kadianakis
9395a0c765 hsv3: Remove support for client auth nicknames.
Because the function that parses client auth credentials saved on
disk (parse_auth_file_content()) is not future compatible, there is no way to
add support for storing the nickname on the disk. Hence, nicknames cannot
persist after Tor restart making them pretty much useless.

In the future we can introduce nicknames by adding a new file format for client
auth credentials, but this was not deemed worth doing at this stage.
2019-12-03 09:22:17 -05:00
George Kadianakis
70572b9abd hsv3: Implement permanent storage of auth credentials.
- See hs_client_register_auth_credentials() for the entry point.
- Also set the permanent flag for credentials we read from the filesystem.
- Also add some missing documentation.
2019-12-03 09:22:17 -05:00
George Kadianakis
53bdd21179 Merge branch 'tor-github/pr/1559' 2019-12-02 12:52:44 +02:00
teor
96e620caaf
Merge remote-tracking branch 'tor-github/pr/1574' 2019-12-01 17:53:06 +10:00
teor
41a3930129 control: Update an outdated function comment
Cleanup after 31531.
2019-11-29 10:55:27 +10:00
teor
f8f278f8c4 control: Remove an unused function return value
Cleanup after 31531.
2019-11-29 10:54:42 +10:00
teor
7a69b3aebc control: Rename a function variable
Cleanup after 31531.
2019-11-29 10:53:32 +10:00
teor
7572988ea9 control: Remove an unnecessary header in control_events.h
And replace it with a struct forward declaration.

Also, move all the headers in the file before the forward
declaration.

Cleanup after 31531.
2019-11-29 10:50:09 +10:00
George Kadianakis
68a00c4951 Merge branch 'tor-github/pr/1573' 2019-11-27 15:36:26 +02:00
David Goulet
a423cec670 hs-v3: Remove unused hs_service_intro_circ_has_closed()
Since the removal of ip->circuit_established, this function does litterally
nothing so clean it up.

Part of #32020

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-27 14:52:09 +02:00
David Goulet
cbc495453c hs-v3: Give a cleanup type to hs_circ_cleanup()
By centralizing the circuit cleanup type that is: on close, free and
repurpose, some actions on the circuit can not happen for a certain cleanup
type or for all types.

This passes a cleanup type so the HS subsystem (v2 and v3) can take actions
based on the type of cleanup.

For instance, there is slow code that we do not run on a circuit close but
rather only on free.

Part of #32020

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-27 14:52:09 +02:00
David Goulet
7f83c43594 hs-v3: Note client intro circuit failure
Report back to the v3 subsystem any introduction point client circuit failure
so they can be noted down in the failure cache.

Fixes #32020

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-27 14:52:09 +02:00
David Goulet
1aafe3376e hs-v2: Modernize rend_client_circuit_cleanup() code
Old and messy code path. Structure it in a more pleasant and readable way. No
behavior change with this refactor.

Part of #32020

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-27 14:52:09 +02:00
Neel Chauhan
99cf3f99c0 Make control_event_conf_changed() take a config_line_t 2019-11-26 22:12:23 -05:00