Commit Graph

25239 Commits

Author SHA1 Message Date
Nick Mathewson
6a6486a7bf hs_circuit: use struct declaration.
This frees us from a dependency on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
d7b8377c28 or_options_st.h: Add an include and a struct declaration.
This frees us from some dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
8bb686d8a0 Include x509.h in tortls_internal.h.
This gives us the definition of tor_x509_cert_impl_t, and makes us
less dependent on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
b1dceeca5a Include sys/types.h in fdio.h, for "off_t".
Otherwise our compilation depends on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
7b0d8834f2 Use raw_assert in ht.h
Also, include torerr.h from ht.h if we are using raw_assert.

Otherwise, our includes need to be ordered so that ht.h comes after
util_log.h.
2020-01-09 07:30:35 -05:00
Nick Mathewson
73b83b8f1a Remove extra ; from tt_assert() macro definition.
We were actually omitting the semicolon in a few places, leading to
confusing indentation and some cocci failures.
2020-01-09 07:30:35 -05:00
Nick Mathewson
3ce2304c6d Use new ENABLE/DISABLE_GCC_WARNING
This is an automated commit, generated by:

perl -i -pe 'next if /define/; s/((?:ENABLE|DISABLE)_GCC_WARNING)\(([A-Za-z0-9_\-]+)\)/$1(\"-W$2\")/' src/*/*/*.[ch] src/*/*.[ch]
2020-01-09 07:30:35 -05:00
Nick Mathewson
792e5b2403 Replace DISABLE/ENABLE_GCC_WARNING with something that will confuse clang-format less 2020-01-09 07:30:35 -05:00
teor
648399d6c2
Merge remote-tracking branch 'tor-github/pr/1505' 2019-12-16 08:15:19 +10:00
teor
0bb879e821
src/ext: Add __future__ imports for python 3 compatibility
Closes ticket 32732.
2019-12-12 15:59:47 +10:00
teor
1619f14a04
python: Add __future__ imports for python 3 compatibility
Except for src/ext, which we may not want to modify.

Closes ticket 32732.
2019-12-12 15:58:51 +10: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
David Goulet
71767b06ae Merge branch 'tor-github/pr/1583' 2019-12-10 09:42:09 -05:00
George Kadianakis
c959ea7558 hs-v3: Fix memory leak in test_hs_control_store_permanent_creds() 2019-12-10 09:42:05 -05: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
Taylor Yu
1e8bb79bbe add KV_RAW to kvline.c
Add the KV_RAW flag to kvline_encode().  This allows generation of
output that is compatible with some quirks of the control protocol.

Part of #30984.
2019-12-08 17:09:43 -06:00
Taylor Yu
4b22c739fe clean up kvline_can_encode_lines()
Add a check for '=' characters in needs_escape().  This simplifies the
logic in kvline_can_encode_lines().

Part of #30984.
2019-12-08 17:09:42 -06:00
Nick Mathewson
089466eff3 Merge branch 'maint-0.4.2' 2019-12-06 16:02:08 -05:00
Nick Mathewson
3248630fc8 Merge branch 'maint-0.4.1' into maint-0.4.2 2019-12-06 16:02:08 -05:00
Nick Mathewson
6513102b9d Merge branch 'maint-0.4.0' into maint-0.4.1 2019-12-06 16:02:08 -05:00
Nick Mathewson
c7ca3fc186 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-12-06 16:02:07 -05:00
Nick Mathewson
74cae547e5 Merge branch 'maint-0.2.9' into maint-0.3.5 2019-12-06 16:02:07 -05:00
Karsten Loesing
b7b467d3af Update geoip and geoip6 to the December 3 2019 database. 2019-12-06 11:50:35 +01:00
Nick Mathewson
0a33522b62 Bump to 0.4.2.5 2019-12-05 13:32:30 -05:00
Nick Mathewson
8933c7908d bump version to 0.4.1.7 2019-12-05 13:31:46 -05:00
Nick Mathewson
e66533befa Bump to 0.4.0.6 2019-12-05 13:31:01 -05:00
Nick Mathewson
c53567c36f Bump version to 0.3.5.9 2019-12-05 13:29:49 -05:00
teor
cfa9cc34aa
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-12-05 10:14:01 +10:00
teor
92fb099067
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-12-05 10:13:53 +10:00
teor
46057ec5ae
Merge remote-tracking branch 'tor-github/pr/1424' into maint-0.4.0 2019-12-05 10:13:15 +10:00
teor
aee966cb06
Merge remote-tracking branch 'tor-github/pr/1277' into maint-0.3.5 2019-12-05 10:11:18 +10: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
c7c9899bc4 hsv3: Add tests for permanently storing auth credentials.
Remove Permanent flag from old tests, and make a new test that does all the
permanent things.
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
teor
df6c5382ad
Merge branch 'pr-1569-squashed' 2019-12-03 12:57:06 +10:00
Nick Mathewson
92a6803e1d
Distribute checkSpaceTest.sh and run it when we have perl. 2019-12-03 12:56:53 +10:00