Commit Graph

31169 Commits

Author SHA1 Message Date
Nick Mathewson 4e4f93d364 Add a #ifdef HAVE_UNISTD_H check to buffers.c
Reported on tor-dev by Gisle Vanem.  Bug not in any released Tor

(The suggested patch used _MSC_VER, but that's not how we do stuff
with autoconf.  With autoconf, you detect the feature you want,
rather than trying to list all the systems that do or do not have
it.)
2019-01-03 09:52:19 -05:00
Nick Mathewson 9ba690e33f Merge branch 'maint-0.3.5' 2019-01-03 09:45:56 -05:00
Nick Mathewson abdc6aede2 Merge branch 'ticket28851_035_squashed' into maint-0.3.5 2019-01-03 09:45:53 -05:00
Nick Mathewson b82717b273 Stop re-checking our hardcoded dh parameters on every startup
Closes ticket 28851.
2019-01-03 09:45:43 -05:00
Nick Mathewson 47176eb678 Merge branch 'maint-0.3.5' 2019-01-03 09:44:15 -05:00
Nick Mathewson 98736cf36a Merge remote-tracking branch 'public/ticket28838_035' into maint-0.3.5 2019-01-03 09:44:10 -05:00
Nick Mathewson 27853938a1 Merge branch 'maint-0.3.5' 2019-01-03 09:02:40 -05:00
Nick Mathewson ed62f0fa15 Merge branch 'maint-0.3.4' into maint-0.3.5 2019-01-03 09:02:39 -05:00
Nick Mathewson 3e64553f76 Merge branch 'maint-0.3.3' into maint-0.3.4 2019-01-03 09:02:39 -05:00
Nick Mathewson 1ea3127188 Merge branch 'ticket28973_033_squashed' into maint-0.3.3 2019-01-03 09:01:40 -05:00
Nick Mathewson bf413829cb Detect openssl bug 7712 and work around it.
In theory it would be better to detect this bug in advance, but this
approach is much simpler, and therefore safer to backport.

This closes tor issue 28973.
2019-01-03 09:00:47 -05:00
Nick Mathewson 3e7f13a4ef Merge branch 'maint-0.3.5' 2019-01-02 16:15:39 -05:00
Nick Mathewson 98755cbddf Merge branch 'bug28974_035' into maint-0.3.5 2019-01-02 16:15:34 -05:00
Nick Mathewson eaaeaf7933 Merge branch 'maint-0.3.5' 2019-01-02 16:09:20 -05:00
Nick Mathewson a4b86421d2 ticket 28924 deserves a changes file. I made one, but I guess I forgot to git add 2019-01-02 16:09:10 -05:00
Nick Mathewson 968235ce6f Explicitly ignore check_result() result in test_voting_flags_minimal
Otherwise, coverity complains at is.
2019-01-02 15:45:52 -05:00
Nick Mathewson b33bcb1e63 Add an errno.h include to freespace.c to fix bug 28974. 2019-01-02 15:19:52 -05:00
Kris Katterjohn c11247e957 Fix a buffer overflow in setup_cfg() in src/test/test_voting_flags.c
signed_descriptor_digest has a length of DIGEST_LEN but the memset
used to fill it used DIGEST256_LEN.

Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
2018-12-23 17:46:08 -06:00
Nick Mathewson 99713b176b Merge branch 'maint-0.3.5' 2018-12-21 15:42:58 -05:00
Nick Mathewson a9eec33649 Merge branch 'maint-0.3.4' into maint-0.3.5 2018-12-21 15:42:57 -05:00
Nick Mathewson 70dd6d07bb Merge branch 'orconn-tracker_squashed' 2018-12-21 14:22:11 -05:00
Taylor Yu 2100b35f07 changes file for ticket27167 2018-12-21 14:15:35 -05:00
Taylor Yu f0f971409a Add tests for bootstrap tracker
Part of ticket 27617.
2018-12-21 14:15:35 -05:00
Taylor Yu 85542ee5a0 The big bootstrap phase redefinition
Redefine the set of bootstrap phases to allow display of finer-grained
progress in the early connection stages of connecting to a relay.

This includes adding intermediate phases for proxy and PT connections.

Also add a separate new phase to indicate obtaining enough directory
info to build circuits so we can report that independently of actually
initiating an ORCONN to build the first application circuit.
Previously, we would claim to be connecting to a relay when we had
merely finished obtaining directory info.

Part of ticket 27167.
2018-12-21 14:15:35 -05:00
Taylor Yu 936c93e562 Hook up control_event_bootstrap() to btrack_orconn
Replace a few invocations of control_event_bootstrap() with calls from
the bootstrap tracker subsystem.  This mostly leaves behavior
unchanged.  The actual behavior changes come in the next commit.

Part of ticket 27167.
2018-12-21 14:15:35 -05:00
Taylor Yu 9d29abb34e Add a comment about bto_update_best. 2018-12-21 14:15:21 -05:00
Nick Mathewson fd58e5e498 Fix priority on process subsystem level: it uses "net" 2018-12-21 14:12:20 -05:00
Nick Mathewson ab4395d082 Merge branch 'ticket28847' 2018-12-21 13:26:47 -05:00
Alexander Færøy bc836d559d Don't initialize the process module manually in tests.
It's not longer needed for us to initialize the process module in tests.

See: https://bugs.torproject.org/28847
2018-12-21 13:26:38 -05:00
Alexander Færøy 2322b56389 Fix typo in time_sys.h. 2018-12-21 13:26:38 -05:00
Alexander Færøy cf4b3dbd44 Use the subsystem list to initialize and shutdown process module.
This patch makes the process module use the subsystem list for
initializing and shutting down.

See: https://bugs.torproject.org/28847
2018-12-21 13:26:38 -05:00
Nick Mathewson 9190f43b1a Merge branch 'maint-0.3.5' 2018-12-21 11:30:58 -05:00
David Goulet 2420e84ba4 mainloop: Reactivate the linked connection event with a non empty list
Linked connections aren't woken up by libevent due to I/O but rather
artificially so we can, by chunks, empty the spooled object(s).

Commit 5719dfb48f (in 0.3.4.1-alpha) made it
that the schedule_active_linked_connections_event would be only called once at
startup but this is wrong because then we would never go through again the
active linked connections.

Fortunately, everytime a new linked connection is created, the event is
activated and thus we would go through the active list again. On a busy relay,
this issue is mitigated by that but on a slower relays or bridge, a connection
could get stuck for a while until a new directory information request would
show up.

Fixes #28717, #28912
2018-12-21 11:25:23 -05:00
Nick Mathewson 97c9ced70a Try @warning_flags to avoid bloating verbose make logs
We now accumulate warning flags in a separate variable,
"TOR_WARNING_FLAGS", and write it to a "warning_flags" file.  Then
we test whether the compiler will accept "@warning_flags": if so, we
put "@warning_flags" in the CFLAGS; if not, we copy the contents of
"$TOR_WARNING_FLAGS" into the CFLAGS.

Closes ticket 28924.
2018-12-21 10:00:23 -05:00
Taylor Yu b0ae6a332a Add bootstrap tracker subsystem
Add a tracker for bootstrap progress, tracking events related to
origin circuit and ORCONN states.  This uses the ocirc_event and
orconn_event publish-subscribe subsystems.

Part of ticket 27167.
2018-12-20 18:46:17 -06:00
Taylor Yu b0f974633a Add LD_BTRACK log domain for bootstrap tracker
Part of ticket 27167.
2018-12-20 18:46:17 -06:00
Taylor Yu a0b4fa1f16 Add origin circuit event pubsub system
Add a publish-subscribe subsystem to publish messages about changes to
origin circuits.

Functions in circuitbuild.c and circuitlist.c publish messages to this
subsystem.

Move circuit event constants out of control.h so that subscribers
don't have to include all of control.h to take actions based on
messages they receive.

Part of ticket 27167.
2018-12-20 18:46:17 -06:00
Taylor Yu 271b50f54a Add ORCONN event pubsub system
Add a publish-subscribe subsystem to publish messages about changes to
OR connections.

connection_or_change_state() in connection_or.c and
control_event_or_conn_event() in control.c publish messages to this
subsystem via helper functions.

Move state constants from connection_or.h to orconn_state.h so that
subscribers don't have to include all of connection_or.h to take
actions based on changes in OR connection state.  Move event constants
from control.h for similar reasons.

Part of ticket 27167.
2018-12-20 18:46:17 -06:00
Taylor Yu 308dde0c38 Remove unused old_state var in connection_or.c
connection_or_change_state() saved an old_state to pass to
channel_tls_handle_state_change_on_orconn(), which promptly cast it to
void.  Remove this unused variable and parameter.
2018-12-20 17:54:49 -06:00
Nick Mathewson e4109020e9 Merge remote-tracking branch 'tor-github/pr/609' 2018-12-20 16:42:35 -05:00
Alexander Færøy ab0d7d2dd4 Escape the PT K/V data before sending it to the logger.
See: https://bugs.torproject.org/28846
2018-12-20 19:05:50 +01:00
Nick Mathewson 0e6e902cbc Merge branch 'document_--version' 2018-12-20 11:50:48 -05:00
Nick Mathewson 4d9b55907c Even more clarify on --version. 2018-12-20 11:50:40 -05:00
Nick Mathewson 5c85ba3077 Merge remote-tracking branch 'tor-github/pr/608' 2018-12-20 11:42:26 -05:00
Alexander Færøy 01819faaba Remove Process initializer/shutdown function from main.c.
See: https://bugs.torproject.org/28847
2018-12-20 14:36:59 +01:00
Alexander Færøy f7e175db57 Forward declare smartlist_t in process.h
This allows other libraries to include process.h without including
the smartlist_t headers first.

See: https://bugs.torproject.org/28847
2018-12-20 14:36:04 +01:00
Nick Mathewson 973a5db808 Merge remote-tracking branch 'tor-github/pr/445' 2018-12-20 07:53:57 -05:00
Nick Mathewson 9c6283732a Merge branch 'maint-0.3.5' 2018-12-20 07:50:04 -05:00
Nick Mathewson ef97543270 Merge remote-tracking branch 'tor-github/pr/607' into maint-0.3.5 2018-12-20 07:49:59 -05:00
Alexander Færøy 7762088967 No need to log ordinary EOF conditions as LOG_WARN.
Let's not use log_warn() when a pipe is closed under what should be
considered normal conditions.

See: https://bugs.torproject.org/28179
2018-12-20 13:12:53 +01:00