summaryrefslogtreecommitdiff
path: root/src/or/hs_circuit.c
AgeCommit message (Collapse)Author
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.
2018-07-01Remove other needless includes include from or/*.hNick Mathewson
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-07-01Combine DH_BYTES and DH_KEY_LEN; put them in a lib/defs header.Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Extract node_t into its own header.Nick Mathewson
2018-06-15Extract cpath_build_state into its own header.Nick Mathewson
More modules use this than I had expected!
2018-06-15Extract crypt_path_t and relay_crypto_t into their own headersNick Mathewson
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-05-02Optimize legacy intro point digest calculation.Neel Chauhan
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-02-09whitespace and typo cleanupsRoger Dingledine
2018-02-07more fixes for typos, grammar, whitespace, etcRoger Dingledine
some of these ought to have been noticed by the "misspell" tool, so if anybody is debugging it, here are some bug reports :)
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-19Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-19Merge branch 'bug24895_031_02' into bug24895_032_02David Goulet
2018-01-17Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-15v3 onion services now obey MAX_REND_FAILURESRoger Dingledine
New-style (v3) onion services now obey the "max rendezvous circuit attempts" logic. Previously they would make as many rendezvous circuit attempts as they could fit in the MAX_REND_TIMEOUT second window before giving up. Fixes bug 24894; bugfix on 0.3.2.1-alpha.
2017-12-11Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-05hs-v3: Cleanup HS circuits when marking as closedDavid Goulet
First, hs_service_intro_circ_has_closed() is now called in circuit_mark_for close() because the HS subsystem needs to learn when an intro point is actually not established anymore as soon as possible. There is a time window between a close and a free. Second, when we mark for close, we also remove it from the circuitmap because between the close and the free, a service can launch an new circuit to that same intro point and thus register it which only succeeds if the intro point authentication key is not already in the map. However, we still do a remove from the circuitmap in circuit_free() in order to also cleanup the circuit if it wasn't marked for close prior to the free. Fixes #23603 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-17Add error message for exit_node in hs_circ_send_introduce1()Neel Chauhan
2017-11-17Use memset() on intro1_data in hs_circ_send_introduce1()Neel Chauhan
2017-11-17Add smartlist_add() to get_lspecs_from_node)Neel Chauhan
2017-11-12Make setup_introduce1_data() take a node_t instead of an extend_info_tNeel Chauhan
Clients add rendezvous point IPv6 addresses to introduce cell link specifiers, when the node has a valid IPv6 address. Also check the node's IPv4 address is valid before adding any link specifiers. Implements #23577.
2017-11-02Tweak a comment for a minor but important distinctionNick Mathewson
2017-11-02Improve v3 onion service logging for intro and rend pointsteor
Diagnostics for #23820.
2017-11-02Remove buggy IPv6 and ed25519 handling from get_lspecs_from_extend_info()teor
The previous version of this function had the following issues: * it didn't check if the extend_info contained an IPv6 address, * it didn't check if the ed25519 identity key was valid. But we can't add IPv6 support in a bugfix release. Instead, BUG() if the address is an IPv6 address, so we always put IPv4 addresses in link specifiers. And ignore missing ed25519 identifiers, rather than generating an all-zero link specifier. This supports v3 hidden services on IPv4, dual-stack, and IPv6, and v3 single onion services on IPv4 only. Part of 23820, bugfix on 0.3.2.1-alpha.
2017-09-25prop224: Add test for parsing RENDEZVOUS1 cell.George Kadianakis
Just making sure that added padding does not screw up cell parsing.
2017-09-19hs: Pad RENDEZVOUS1 v3 cell to match length of v2David Goulet
RENDEZVOUS1 cell is 84 bytes long in v3 and 168 bytes long in v2 so this commit pads with random bytes the v3 cells up to 168 bytes so they all look alike at the rendezvous point. Closes #23420 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Register RP circuit when it opensDavid Goulet
Only register the RP circuit when it opens and not when we send the INTRODUCE1 cell else, when re-extending to a new IP, we would register the same RP circuit with the same cookie twice leading to the circuit being closed. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add a function to clear INTRO dataDavid Goulet
New function named hs_cell_introduce1_data_clear() is introduced to clear off an hs_cell_introduce1_data_t object. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Use the client-side circuitmap in hs_client.cGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Build ESTABLISH_RENDEZVOUS cell and logicDavid Goulet
Add a function to build the cell. Add a the logic to send the cell when the rendezvous circuit opens. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Build INTRODUCE1 cell and send logicDavid Goulet
Add a function in hs_cell.{c|h} for a client to build an INTRODUCE1 cell using an object that contains all the needed keys to do so. Add an entry point in hs_client.c that allows a tor client to send an INTRODUCE1 cell on a given introduction circuit. It includes the building of the cell, sending it and the setup of the rendezvous circuit with the circuit identifier. The entry point function is still unused at this commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Make lspecs to extend info publicDavid Goulet
The hs circuit file had this function that takes a list of link specifiers and return a newly allocated extend info object. Make it public so the client side can also use it to be able to extend to introduction point. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-11Make Windows happy for time_t printf formatDavid Goulet
Our Windows compiler treats "time_t" as long long int but Linux likes it long int so cast those to make Windows happy. 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: Improve comments and tests for ed25519 keys in IPs/RPs.George Kadianakis
Also make sure we are not gonna advertise the ed25519 key of an intro point that doesn't support it.
2017-08-08Improve docs on rendezvous circ relaunch.George Kadianakis
2017-08-08Improve code based on Nick review:George Kadianakis
- Fix some more crazy ternary ops. - Fix the order of disaster SRV computation. - Whitespace fixes. - Remove a redundant warn. - Better docs.
2017-08-08Fix small easy bugs all aroundGeorge Kadianakis
- Fix log message format string. - Do extra circuit purpose check. - wipe memory in a clear function - Make sure we don't double add intro points in our list - Make sure we don't double close intro circuits. - s/tt_u64_op/tt_i64_op/
2017-08-08Constify functions that can be constified.George Kadianakis
2017-08-08Improve documentation all around the codebase.George Kadianakis
2017-08-08Make ed25519 id keys optional for IPs and RPs.George Kadianakis
2017-08-08prop224: Remove INTRODUCE2 legacy handlingDavid Goulet
Turns out that introduction points don't care about the INTRODUCE2 cell format as long as the top field is LEGACY_KEY_ID as expected. So let's use a single INTRODUCE format regardless of the introduction point being legacy or not. This also removes the polymorphic void* situation. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Move get_intro_circuit() to hs_circuit.cDavid Goulet
Make this function public so we can use it both in hs_circuit.c and hs_service.c to avoid code duplication. 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>