summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_circuit.c
AgeCommit message (Collapse)Author
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-10-27hs: Collect rendezvous circuit metricsDavid Goulet
The total number of rendezvous circuit created and the number of established ones which is a gauge that decreases to keep an updated counter. Related to #40063 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-02Extract extend_info manipulation functions into a new file.Nick Mathewson
2020-04-08fix typos from #32542Roger Dingledine
2020-04-08hs-v3: Report rendezvous circuit failure SOCKS ExtendedErrorsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-30hs-v3: Move ob_subcreds to hs_service_state_t.George Kadianakis
It's more natural there since it's runtime state.
2020-02-11Make n_subcredentials a size_t .George Kadianakis
Based on David's review.
2020-01-28Write unittest that covers cases of INTRODUCE1 handling.George Kadianakis
Also fix some memleaks of other OB unittests.
2020-01-28Unify INTRO2 handling codepaths in OB and normal cases.George Kadianakis
Now we use the exact same INTRO2 decrypt logic regardless of whether the service is an OB instance or not. The new get_subcredential_for_handling_intro2_cell() function is responsible for loading the right subcredentials in either case.
2020-01-21Pass multiple subcredentials all the way down to hs_ntor.Nick Mathewson
This approach saves us a pair of curve25519 operations for every subcredential but the first. It is not yet constant-time. I've noted a few places where IMO we should refactor the code so that the complete list of subcredentials is passed in earlier.
2020-01-21Turn hs_subcredential_t into a proper struct.Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-10Merge branch 'tor-github/pr/1581'George Kadianakis
2019-12-10hs-v3: Handle client rendezvous circuit timeoutDavid Goulet
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-03hs-v3: Fix NULL deref. in hs_circ_service_get_established_intro_circ()David Goulet
Found by Stem regression tests. Reported by atagar. Fixes #32664 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-27hs-v3: Give a cleanup type to hs_circ_cleanup()David Goulet
By centralizing the circuit cleanup type that is: on close, free and repurpose, some actions on the circuit can not happen for a certain cleanup type or for all types. This passes a cleanup type so the HS subsystem (v2 and v3) can take actions based on the type of cleanup. For instance, there is slow code that we do not run on a circuit close but rather only on free. Part of #32020 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-27hs-v3: Note client intro circuit failureDavid Goulet
Report back to the v3 subsystem any introduction point client circuit failure so they can be noted down in the failure cache. Fixes #32020 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-20hs-v2: Move v2 circuit cleanup actions into hs_circ_cleanup()David Goulet
Refactor to decomplexify circuit_about_to_free() and finally have one single entry point into the HS subsystems (v2 and v3) for when a circuit is freed. With this, hs_circ_cleanup() becomes the one and only entry point when a circuit is freed which then routes to the right subsystem version for any actions to be taken. This moves a big chunk of code from circuituse.c to rendclient.c. No behavior change. Next commit will refactor it to reduce our technical debt. Part of #32020 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-07Fix various doxygen comments in feature/hs.Nick Mathewson
2019-10-23hs-v3: Remove the circuit_established intro flagDavid Goulet
Only use the HS circuit map to know if an introduction circuit is established or not. No need for a flag to keep state of something we already have in the circuit map. Furthermore, the circuit map gets cleaned up properly so it will always have the "latest truth". This commit also removes a unit test that was testing specifically that flag but now we rely solely on the HS circuit map which is also tested few lines below the removed test. Fixes #32094 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-09Merge branch 'ticket30924_042_04_squashed' into ↵Nick Mathewson
ticket30924_042_04_squashed_merged
2019-08-29Merge branch 'tor-github/pr/1257'David Goulet
2019-08-29Merge branch 'maint-0.4.1'David Goulet
2019-08-29Merge branch 'tor-github/pr/1256' into maint-0.4.1David Goulet
2019-08-26hs-v3: Encode DoS ESTABLISH_INTRO cell extensionDavid Goulet
This commit makes tor add the DoS cell extension to the ESTABLISH_INTRO cell if the defense is enabled on the service side with a torrc option. Furthermore, the cell extension is only added if the introduction point supports it. The protover version HSIntro=5 is looked for. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-23Remove the unused circuit_type field from hs_ident_circuit_t and ↵Neel Chauhan
hs_ident_circuit_new()
2019-08-23hs: Remove an outdated commentteor
2019-08-23Merge branch 'bug23818_035' into bug23818_masterteor
2019-08-23hs: v3 single onion services fall back to 3-hop intro for unreachable nodesteor
Previously, v3 single onion services failed when all intro nodes were unreachable via a 1-hop path. Now, we select intros that are only available via a 3-hop path, and use a 3-hop path to connect to them. Fixes bug 23507; bugfix on 0.3.2.1-alpha.
2019-08-23hs: Always use a 3-hop path when a v3 single onion intro failsteor
Previously, we always used a 1-hop path, no matter how many times a v3 single onion intro failed. Fixes bug 23818; bugfix on 0.3.2.1-alpha.
2019-08-23hs: Always use a 3-hop path when a v3 single onion rend failsteor
Previously, we used a 1-hop path when a single onion rend failed immediately, and a 3-hop path when it failed after trying to build a circuit. Fixes bug 23818; bugfix on 0.3.2.1-alpha.
2019-06-05Revert "hs: Implement a helper to repurpose a circuit"Mike Perry
This reverts commit 3789f22bcbfbc6de415a838e4c4bfb2555c7d6c3.
2019-06-05Merge remote-tracking branch 'tor-github/pr/1053'Nick Mathewson
2019-05-29hs: Implement a helper to repurpose a circuitDavid Goulet
When we repurpose a hidden service circuit, we need to clean up from the HS circuit map and any HS related data structured contained in the circuit. This commit adds an helper function that does it when repurposing a hidden service circuit. Fixes #29034 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Revert "Hiding crypt_path_t: Create a constructor for crypt_path_t."George Kadianakis
This reverts commit ab8b80944967ee5a6a0c45dbf61839cf257bfe44.
2019-05-03Hiding crypt_path_t: Rename some functions to fit the crypt_path API.George Kadianakis
Some of these functions are now public and cpath-specific so their name should signify the fact they are part of the cpath module: assert_cpath_layer_ok -> cpath_assert_layer_ok assert_cpath_ok -> cpath_assert_ok onion_append_hop -> cpath_append_hop circuit_init_cpath_crypto -> cpath_init_circuit_crypto circuit_free_cpath_node -> cpath_free onion_append_to_cpath -> cpath_extend_linked_list
2019-05-03Hiding crypt_path_t: Create a constructor for crypt_path_t.George Kadianakis
We are using an opaque pointer so the structure needs to be allocated on the heap. This means we now need a constructor for crypt_path_t. Also modify all places initializing a crypt_path_t to use the constructor.
2019-05-03Hiding crypt_path_t: Move init functions to crypt_path.c.George Kadianakis
This commit only moves code.
2019-01-30hs: Move get_lspecs_from_node to nodelist.cteor
Also: * rename to node_get_link_specifier_smartlist * rewrite to return a smartlist * add link_specifier_smartlist_free Part of 23576.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.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-21hs-v3: Don't BUG() if the RP node_t is invalid client sideDavid Goulet
When sending the INTRODUCE1 cell, we acquire the needed data for the cell but if the RP node_t has invalid data, we'll fail the send and completely kill the SOCKS connection. Instead, close the rendezvous circuit and return a transient error meaning that Tor can recover by selecting a new rendezvous point. We'll also do the same when we are unable to encode the INTRODUCE1 cell for which at that point, we'll simply take another shot at a new rendezvous point. Fixes #27774 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-07-25Merge branch 'bug26627_033' into bug26627_033_merged_masterteor
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.