Commit Graph

25263 Commits

Author SHA1 Message Date
Nick Mathewson
5c240db0bf Restore feature where nt-services detect non-"run_tor" modes.
Followup for #32883.
2020-01-06 09:25:23 -05:00
Nick Mathewson
13216f848a Merge branch 'maint-0.4.2' 2020-01-06 08:08:59 -05:00
Nick Mathewson
16e94dc7a7 Merge branch 'maint-0.4.1' into maint-0.4.2 2020-01-06 08:06:54 -05:00
Peter Gerber
b9d81282e0 Fix sandbox crash during reload of logging configuration
Allow calls to dup() which was introduced in commit a22fbab986.

From a security perspective, I don't think this should impact the
security of the sandbox significantly. As far as I can tell, there
is nothing an adversary can do with a duplicated FD that can't be
done with the original.
2020-01-05 15:24:45 +00:00
Neel Chauhan
b062e0f0a4 Fix spacing in tor_sscanf() call in tor_inet_aton() 2019-12-20 14:11:03 -05:00
Neel Chauhan
01c6fde326 Fix spacing in tor_inet_aton() function header 2019-12-20 14:10:43 -05:00
Nick Mathewson
33a0f15b21 Merge branch 'bug29819_035' 2019-12-20 07:37:47 -05:00
teor
8c23ac4ae7 Replace several C identifiers.
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \
        TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \
        CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \
        EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \
        SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-12-20 13:27:58 +10:00
teor
cd160291a7
Code Style: Delete headers that are included twice
These changes were created using the "make autostyle" from
32522, and then split into commits.
2019-12-20 09:53:31 +10:00
teor
d8b868e483
Code Style: Delete PRIVATE defines that are never used
Some ".c" files define *_PRIVATE macros, but those macros are
not used in any header file. Delete them.

These changes were created using the "make autostyle" from
32522, and then split into commits.
2019-12-20 09:50:50 +10:00
teor
57b6678d52 Run "make autostyle" 2019-12-20 09:45:53 +10: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
8d474e4dc5 Add an integration test for options disabled by dirauth subsystem. 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
419ba97df5 Allow struct_magic to be disabled.
When a subsystem is disabled, there will be no corresponding object
allocated, and no magic numbers on it.
2019-12-19 07:54:56 -05:00
Nick Mathewson
9082a6db3f Support a flag to indicate that a config var is disabled
Like "obsolete" variables, these variables produce a warning when
you try to set them, but the warning says that the relevant module
doesn't have support.

The confdecl macros now have a CONF_CONTEXT that you can define to
make all the modules in a given table disabled.
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
Nick Mathewson
08bfc2d71a Merge branch 'ticket32172_once_again' 2019-12-17 15:02:06 -05:00
Peter Gerber
0d64bafcfe Correct how we use libseccomp
This fixes a startup crash with libseccomp v2.4.0 if Sandbox is
set to 1.
2019-12-17 09:47:28 -05:00
Nick Mathewson
5f9808d1d7 Merge remote-tracking branch 'tor-github/pr/1596' 2019-12-17 09:39:50 -05:00
David Goulet
47d69d981e Merge branch 'tor-github/pr/1608' 2019-12-17 09:30:19 -05:00
Neel Chauhan
ec35593e42 Compact lines in test_e2e_rend_circuit_setup() 2019-12-16 14:26:12 -05:00
Neel Chauhan
f684fd79e9 Remove extra space from helper_get_circ_and_stream_for_test() call in test_e2e_rend_circuit_setup() 2019-12-16 14:19:55 -05:00
teor
648399d6c2
Merge remote-tracking branch 'tor-github/pr/1505' 2019-12-16 08:15:19 +10:00
Nick Mathewson
1d0ccda595 Add torint.h include to confdecl.h.
This change allows other modules to include confdecl.h without
having first to include integer types they might not even use.
2019-12-15 11:46:05 -05: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
Taylor Yu
0fd49c6663 Document high-level architecture goals
Create a high-level description of the long-term software architecture
goals.  Closes ticket 32206.
2019-12-10 16:47:38 -06:00
Hans-Christoph Steiner
4d4cbf739f set up tmp dir for test suite to run on Android
There is no /tmp or mkdtemp on Android, there is /data/local/tmp for
root and the shell user. So this fakes mkdtemp.  Also, FYI, tor might
not like the default perms of /data/local/tmp, e.g. 0770.

https://trac.torproject.org/projects/tor/ticket/32172
2019-12-10 15:55:40 -05: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
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
Nick Mathewson
b7d18f8610 bump to 0.4.2.5-dev 2019-12-09 16:03:31 -05:00
Nick Mathewson
7174a80edd bump to 0.4.1.7-dev 2019-12-09 16:02:36 -05:00
Nick Mathewson
0c4f0ec977 bump to 0.3.5.9-dev 2019-12-09 16:01:11 -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