aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
AgeCommit message (Collapse)Author
2018-07-09Merge remote-tracking branch 'mikeperry/bug25705_v3_033' into maint-0.3.3Nick Mathewson
2018-05-01Bug 25705: Don't count circuit path failures as build failures.Mike Perry
Also emit a rate limited log message when they happen, since they are likely correlated with other issues.
2018-04-22Check for "the right descriptor", not just "any descriptor".Nick Mathewson
This patch adds a new node_has_preferred_descriptor() function, and replaces most users of node_has_descriptor() with it. That's an important change, since as of d1874b433953f64 (our fix for #25213), we are willing to say that a node has _some_ descriptor, but not the _right_ descriptor for a particular use case. Part of a fix for 25691 and 25692.
2018-04-11Bug 24989: Count client hsdir gets towards MaxClientCircuitsPending.Mike Perry
We removed this by breaking them out from general in #13837.
2018-02-14Merge remote-tracking branch 'mikeperry/bug24769'Nick Mathewson
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-06Merge remote-tracking branch 'dgoulet/bug25116_029_01'Nick Mathewson
2018-02-05Make circuit_log_ancient_one_hop_circuits() ignore established service ↵David Goulet
rendezvous Services can keep rendezvous circuits for a while so don't log them if tor is a single onion service. Fixes #25116 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31Bug 24769: Reduce and parameterize the max number of cbt circs.Mike Perry
Setting the default for this at 10 and the learning timeout to 3 minutes means we will complete our cbt learning in 30 minutes, which is under the reduced padding connection timeout window.
2018-01-26Remove a needless (always-true) check.Nick Mathewson
Also add an assertion and rename a variable. Closes ticekt 24927.
2018-01-23Merge remote-tracking branch 'mikeperry/bug24946'Nick Mathewson
2018-01-23Add onion service activity information to our heartbeat logs.George Kadianakis
2018-01-20Bug 24946: Fix a warning message caused by a missed purpose check.Mike Perry
Also fix three other checks (found by inspection of all CIRCUIT_PURPOSE_C_GENERAL occurrences).
2018-01-19Bug 23101: Pre-build HS-specific circuits (instead of general).Mike Perry
Prebuilt circs are 4 hops, since only server side HSDIR and intro circs are 3 hops, and it is OK if those sometimes take longer to build.
2018-01-19Add new circuit purposes for hsdir activity.Mike Perry
This lets us control their path len and usage.
2018-01-19Implement layer 2 and layer 3 guard pinning via torrc.Mike Perry
Block circuit canibalization when HSRendezvousMiddleNodes is active. Also make it apply to all HS circuits, not just rends.
2017-12-12Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-12Merge branch 'bug24367_032_squashed' into maint-0.3.2Nick Mathewson
2017-12-12Simplify some conditionals in circuit_get_open_circ_or_launch()teor
When entry_list_is_constrained() is true, guards_retry_optimistic() always returns true. When entry_list_is_constrained() is false, options->UseBridges is always false, therefore !options->UseBridges is always true, therefore (!options->UseBridges || ...) is always true. Cleanup after #24367.
2017-12-08Merge remote-tracking branch 'mikeperry/bug23114_squashed2'Nick Mathewson
2017-12-07Merge branch 'arthuredelstein_18859+1_031' into maint-0.3.2Nick Mathewson
2017-12-07Add tests for circuitstats.cMike Perry
These tests primarily test the relaxed and measured behavior of circuitstats.c, to make sure we did not break it with #23100 or #23114.
2017-12-07Bug #23114: Time out circuits immediately.Mike Perry
This changes the purpose of circuits that are past the timeout to measurement *as they are built*, ensuring accurate application of the timeout logic.
2017-12-06Don't consider a port "handled" by an isolated circuit.Arthur Edelstein
Previously, circuit_stream_is_being_handled incorrectly reported that (1) an exit port was "handled" by a circuit regardless of whether the circuit was already isolated in some way, and (2) that a stream could be "handled" by a circuit even if their isolation settings were incompatible. As a result of (1), in Tor Browser, circuit_get_unhandled_ports was reporting that all ports were handled even though all non-internal circuits had already been isolated by a SOCKS username+password. Therefore, circuit_predict_and_launch_new was declining to launch new exit circuits. Then, when the user visited a new site in Tor Browser, a stream with new SOCKS credentials would be initiated, and the stream would have to wait while a new circuit with those credentials could be built. That wait was making the time-to-first-byte longer than it needed to be. Now, clean, not-yet-isolated circuit(s) will be automatically launched ahead of time and be ready for use whenever a new stream with new SOCKS credentials (or other isolation criteria) is initiated. Fixes bug 18859. Thanks to Nick Mathewson for improvements.
2017-11-22Stop checking cached bridge descriptors for usable bridgesteor
Stop checking for bridge descriptors when we actually want to know if any bridges are usable. This avoids potential bootstrapping issues. Fixes bug 24367; bugfix on 0.2.0.3-alpha. Stop stalling when bridges are changed at runtime. Stop stalling when old bridge descriptors are cached, but they are not in use. Fixes bug 24367; bugfix on 23347 in 0.3.2.1-alpha.
2017-11-20Merge branch 'bug23681_029_01_squashed' into maint-0.3.2Nick Mathewson
2017-11-20circuit: Don't timeout opened C_INTRODUCING circuitDavid Goulet
A circuit with purpose C_INTRODUCING means that its state is opened but the INTRODUCE1 cell hasn't been sent yet. We shouldn't consider that circuit when looking for timing out "building circuit". We have to wait on the rendezvous circuit to be opened before sending that cell so the intro circuit needs to be kept alive for at least that period of time. This patch makes that the purpose C_INTRODUCING is ignored in the circuit_expire_building() which means that we let the circuit idle timeout take care of it if we end up never using it. Fixes #23681 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25circuit: Log n_circ_id and global identifier of HS circuitsDavid Goulet
So we can track them more easily in the logs and match any open/close/free with those identifiers. Part of #23645 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25circuit: Log circuit identifiers when cannibalizingDavid Goulet
This removes the "nickname" of the cannibalized circuit last hop as it is useless. It now logs the n_circ_id and global identifier so we can match it with other logging statement. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-22Merge branch 'bug22805_v2_squashed'Nick Mathewson
2017-09-22Remove or_circuit_t.is_first_hop; use channel_is_client() insteadNick Mathewson
The is_first_hop field should have been called used_create_fast, but everywhere that we wanted to check it, we should have been checking channel_is_client() instead.
2017-09-20circuit: Log n_circ_id and global identifierDavid Goulet
When we can, log the n circuit id and global identifier for origin circuit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-08Merge branch 'ed25519_lookup'Nick Mathewson
2017-09-07prop224: Pick rendezvous point of protover HSRend=2David Goulet
Version 3 hidden service needs rendezvous point that have the protocol version HSRend >= 2 else the rendezvous cells are rejected. Fixes #23361 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24circuit: Consider v3 hidden service circuit in circuit_expire_building()David Goulet
For a ready v3 rendezvous circuit, consider it so we don't expire. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24circuit: Avoid needless log info in circuit_get_best()David Goulet
When looking for an introduction circuit in circuit_get_best(), we log an info message if we are about to launch a new intro circuit in parallel. However, the condition was considering marked for close circuit leading to the function triggering the log info even though there is actually no valid intro circuit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Make client send INTRODUCE1 cellDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Client has opened circuit logicDavid Goulet
Make a single entry point for the entire HS subsystem when a client circuit opens (every HS version). Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-22Refactor node lookup APIs to take flagsNick Mathewson
Right now there's a single warn_if_unnamed flag for router_get_consensus_status_by_nickname() and node_get_by_nickname(), that is nearly always 1. I've turned it into an 'unsigned' bitfield, and inverted its sense. I've added the flags argument to node_get_by_hex_id() too, though it does nothing there right now. I've removed the router_get_consensus_status_by_nickname() function, since it was only used in once place. This patch changes the warning behavior of GETINFO ns/name/<name>, since all other name lookups from the controller currently warn. Later I'm going to add more flags, for ed25519 support.
2017-08-08prop224: Function to inc/decrement num rendezvous streamGeorge Kadianakis
Add a common function for both legacy and prop224 hidden service to increment and decrement the rendezvous stream counter on an origin circuit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Always note down the use of internal circuitDavid Goulet
Also, this removes all the callsite of this rephist in the hs subsystem Fixes #23097 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Make circuit prediction aware of v3 servicesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Add service rendezvous circuit relaunchDavid Goulet
This introduces a callback to relaunch a service rendezvous circuit when a previous one failed to build or expired. It unifies the legacy function rend_service_relaunch_rendezvous() with one for specific to prop224. There is now only one entry point for that which is hs_circ_retry_service_rendezvous_point() supporting both legacy and prop224 circuits. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08hs: Rename num_rend_services()David Goulet
Renamed to rend_num_services() so it is consistent with the legacy naming. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Circuit has opened and ESTABLISH_INTRO cellDavid Goulet
Add the entry point from the circuit subsystem of "circuit has opened" which is for all type of hidden service circuits. For the introduction point, this commit actually adds the support for handling those circuits when opened and sending ESTABLISH_INTRO on a circuit. Rendevzou point circuit aren't supported yet at this commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Service v3 descriptor creation and logicDavid Goulet
This commit adds the functionality for a service to build its descriptor. Also, a global call to build all descriptors for all services is added to the service scheduled events. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-07test: Introduce hs_client_note_connection_attempt_succeeded().George Kadianakis
This commit paves the way for the e2e circuit unittests. Add a stub for the prop224 equivalent of rend_client_note_connection_attempt_ended(). That function was needed for tests, since the legacy function would get called when we attach streams and our client-side tests would crash with assert failures on rend_data. This also introduces hs_client.[ch] to the codebase.
2017-07-07Refactor legacy code to support hs_ident along with rend_data.George Kadianakis
The legacy HS circuit code uses rend_data to match between circuits and streams. We refactor some of that code so that it understands hs_ident as well which is used for prop224.
2017-05-09Merge branch 'dgoulet_ticket22060_031_01_squashed'Nick Mathewson