aboutsummaryrefslogtreecommitdiff
path: root/src/feature/client
AgeCommit message (Collapse)Author
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.1 version.)
2019-11-25Merge branch 'maint-0.4.0' into maint-0.4.1teor
2019-10-17Remove overly strict assertions in transports.c.Alexander Færøy
This patch removes an overly strict tor_assert() and an ignorable BUG() expression. Both of these would trigger if a PT was unable to configure itself during startup. The easy way to trigger this is to configure an obfs4 bridge where you make the obfs4 process try to bind on a port number under 1024. See: https://bugs.torproject.org/31091
2019-09-17Merge branch 'maint-0.4.0' into maint-0.4.1Nick Mathewson
2019-09-17Merge branch 'maint-0.3.5' into maint-0.4.0Nick Mathewson
2019-09-06entrynodes: Make routine descriptor expiry notice logs less alarmingteor
When tor is missing descriptors for some primary entry guards, make the log message less alarming. It's normal for descriptors to expire, as long as tor fetches new ones soon after. Fixes bug 31657; bugfix on 0.3.3.1-alpha.
2019-08-30Merge branch 'maint-0.3.5' into maint-0.4.0teor
2019-08-30Merge remote-tracking branch 'tor-github/pr/1117' into maint-0.3.5teor
2019-08-12Merge branch 'maint-0.3.5' into maint-0.4.0teor
2019-06-19guard: Ignore marked for close circuit when changing state to openDavid Goulet
When we consider all circuits in "waiting for guard" state to be promoted to an "open" state, we were considering all circuits, even the one marked for close. This ultiamtely triggers a "circuit_has_opened()" called on the circuit that is marked for close which then leads to possible undesirable behaviors within a subsystem. For instance, the HS subsystem would be unable to find the authentication key of the introduction point circuit leading to a BUG() warning and a duplicate mark for close on the circuit. This commit also adds a unit test to make sure we never select marked for close circuits when upgrading its guard state from waiting for guard to open. Fixes #30871 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-19guard: Ignore marked for close circuit when changing state to openDavid Goulet
When we consider all circuits in "waiting for guard" state to be promoted to an "open" state, we were considering all circuits, even the one marked for close. This ultiamtely triggers a "circuit_has_opened()" called on the circuit that is marked for close which then leads to possible undesirable behaviors within a subsystem. For instance, the HS subsystem would be unable to find the authentication key of the introduction point circuit leading to a BUG() warning and a duplicate mark for close on the circuit. This commit also adds a unit test to make sure we never select marked for close circuits when upgrading its guard state from waiting for guard to open. Fixes #30871 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-31Merge branch 'bug29875_035' into bug29875_masterNick Mathewson
2019-05-31num_bridges_usable(): only count configured bridges.Nick Mathewson
When this function was implemented, it counted all the entry guards in the bridge set. But this included previously configured bridges, as well as currently configured ones! Instead, only count the _filtered_ bridges (ones that are configured and possibly reachable) as maybe usable. Fixes bug 29875; bugfix on 0.3.0.1-alpha.
2019-05-15Add control port circuit ID to all pathbias bug messages.Mike Perry
To ease debugging of miscount issues, attach vanguards with --loglevel DEBUG and obtain control port logs (or use any other control port CIRC and CIRC_MINOR event logging mechanism).
2019-05-15Pathbias should continue to ignore previously ignored circs.Mike Perry
If circuit padding wants to keep a circuit open and pathbias used to ignore it, pathbias should continue to ignore it. This may catch other purpose-change related miscounts (such as timeout measurement, cannibalization, onion service circuit transitions, and vanguards).
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-26Use fast check for missing id in node_is_a_configured_bridge()Nick Mathewson
Fixes bug 30308; bugfix on 0.3.5.1-alpha.
2019-04-11Add an assertion to pathbias_get_scale_ratio()Nick Mathewson
This should please coverity, and fix CID 1415723. It didn't understand that networkstatus_get_param() always returns a value between its minimum and maximum values.
2019-03-25Split all controller events code into a new control_events.cNick Mathewson
Also, split the formatting code shared by control.c and control_events.c into controller_fmt.c.
2019-03-05Set TOR_PT_EXIT_ON_STDIN_CLOSE=1 for client transports too.David Fifield
Closes #25614.
2019-02-26Fix crash bug in PT subsystem.Alexander Færøy
This patch fixes a crash bug (assertion failure) in the PT subsystem that could get triggered if the user cancels bootstrap via the UI in TorBrowser. This would cause Tor to call `managed_proxy_destroy()` which called `process_free()` after it had called `process_terminate()`. This leads to a crash when the various process callbacks returns with data after the `process_t` have been freed using `process_free()`. We solve this issue by ensuring that everywhere we call `process_terminate()` we make sure to detach the `managed_proxy_t` from the `process_t` (by calling `process_set_data(process, NULL)`) and avoid calling `process_free()` at all in the transports code. Instead we just call `process_terminate()` and let the process exit callback in `managed_proxy_exit_callback()` handle the `process_free()` call by returning true to the process subsystem. See: https://bugs.torproject.org/29562
2019-02-14Merge branch 'tor-github/pr/536' into maint-0.3.5George Kadianakis
2019-01-17Merge remote-tracking branch 'tor-github/pr/645'Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-14Rename TYPE to TRANSPORT in PT STATUS messages.Alexander Færøy
See: https://bugs.torproject.org/28181
2019-01-09Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-09Stop logging 'Your Guard' in circpathbias.crl1987
2018-12-20Escape the PT K/V data before sending it to the logger.Alexander Færøy
See: https://bugs.torproject.org/28846
2018-12-20Add support for STATUS messages from Pluggable Transports.Alexander Færøy
This patch adds support for the new STATUS message that PT's can emit from their standard out. The STATUS message uses the `config_line_t` K/V format that was recently added in Tor. See: https://bugs.torproject.org/28846
2018-12-20Use K/V parser to handle LOG messages for pluggable transports.Alexander Færøy
This patch changes the LOG pluggable transport message to use the recent K/V parser that landed in Tor. This allows PT's to specify the log severity level as well as the message. A mapping between the PT log severity levels and Tor's log serverity level is provided. See: https://bugs.torproject.org/28846
2018-12-17Merge branch 'ticket28179_squashed' into ticket28179_squashed_mergedNick Mathewson
2018-12-17Add an additional space when we check for the PROTO_LOG handler.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Use `const char *` instead of `char *` for line parameter for process callbacks.Alexander Færøy
This patch changes the type definition of the process callbacks to use `const char *` instead of `char *`. See: https://bugs.torproject.org/28179
2018-12-17Change EVENT_TRANSPORT_LOG to EVENT_PT_LOG.Alexander Færøy
This patch changes our EVENT_TRANSPORT_LOG event to be EVENT_PT_LOG. The new message includes the path to the PT executable instead of the transport name, since one PT binary can include multiple transport they sometimes might need to log messages that are not specific to a given transport. See: https://bugs.torproject.org/28179
2018-12-17Change the Process exit_callback to return bool.Alexander Færøy
This patch changes our process_t's exit_callback to return a boolean value. If the returned value is true, the process subsystem will call process_free() on the given process_t. See: https://bugs.torproject.org/28179
2018-12-17Move remaining code from subprocess.{h,c} to more appropriate places.Alexander Færøy
This patch moves the remaining code from subprocess.{h,c} to more appropriate places in the process.c and process_win32.c module. We also delete the now empty subprocess module files. See: https://bugs.torproject.org/28179
2018-12-17Delete old process_handle_t code.Alexander Færøy
This patch removes the old process_handle_t code. Everything should by now be using the process_t interface. See: https://bugs.torproject.org/28179
2018-12-17Add support for logging messages from pluggable transports.Alexander Færøy
This patch adds support for the "LOG" protocol message from a pluggable transport. This allows pluggable transport developers to relay log messages from their binary to Tor, which will both emit them as log messages from the Tor process itself, but also pass them on via the control port. See: https://bugs.torproject.org/28180 See: https://bugs.torproject.org/28181 See: https://bugs.torproject.org/28182
2018-12-17Use process_t for managed proxies.Alexander Færøy
This patch makes the managed proxy subsystem use the process_t data structure such that we can get events from the PT process while Tor is running and not just when the PT process is being configured. See: https://bugs.torproject.org/28179
2018-12-01Merge branch 'ticket27490a_squashed'Nick Mathewson
2018-12-01Add new option ClientAutoIPv6ORPort to switch between IPv4 and IPv6 OR portsNeel Chauhan
2018-12-01Merge remote-tracking branch 'tor-github/pr/536'Nick Mathewson
2018-11-27Remove unused `int pid` member of `managed_proxy_t`.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-22Entry Nodes: Use a reasonably live consensus to select guardsteor
Fixes bug 24661; bugfix on 0.3.0.1-alpha.
2018-11-15Make the NET_PARTICIPANT role dependent on user activityNick Mathewson
This patch implements all of 28337, except for the part where we turn off the role if we've been idle for a long time.
2018-10-01Remove routerparse include from files that dont use itNick Mathewson
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson
2018-09-25Revise things that had included router.h beforeNick Mathewson
Make them only include the headers that they needed, and sort their headers while we're at it.
2018-09-21Split directory.c code into several modulesNick Mathewson
Parts of this C file naturally belong in dircache, dirclient, and dircommon: so, move them there.