aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.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-03Return U64_PRINTF_ARG and U64_FORMATNick Mathewson
The standard is printf("%"PRIu64, x);
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-15Move extend_info_t into its own header.Nick Mathewson
2018-06-15Extract cell type and their queues into new headersNick Mathewson
Since packed_cell and destroy_cell exist only to be queued, they go in the same headers as the queues.
2018-06-15Extract routerinfo_t into its own header.Nick Mathewson
I was expecting this to be much worse.
2018-06-15Extract microdesc_t into its own header.Nick Mathewson
2018-06-15Extract routerstatus_t into its own header.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 {or,origin}_circuit_t into their own headersNick Mathewson
2018-06-15Split entry and edge_connection_t into their own headers.Nick Mathewson
2018-06-13Merge branch 'maint-0.3.3'Nick Mathewson
2018-06-13Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-06-13Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-05-22Add a missing "return -1" when checking for Ed25519 ID loopsNick Mathewson
Fixes bug 26158; bugfix on 0.3.0.1-alpha.
2018-05-09Merge branch 'ticket26009'Nick Mathewson
2018-05-09Fix some clang warningsNick Mathewson
2018-05-09Distinguish true clock jumps from idlenessNick Mathewson
Since we're going to be disabling the second-elapsed callback, we're going to sometimes have long periods when no events file, and so the current second is not updated. Handle that by having a better means to detect "clock jumps" as opposed to "being idle for a while". Tolerate far more of the latter. Part of #26009.
2018-05-08Merge remote-tracking branch 'mikeperry/bug25870_rebase'Nick Mathewson
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-05-01Remove the return value from the fascist_firewall_choose_address_* family of ↵Neel Chauhan
functions
2018-05-01Fix memleak found by unittests.George Kadianakis
2018-05-01Write unittests to check basic vanguard path selection.George Kadianakis
Adds two unittests: - First checks the path selection of basic Tor circs. - Second checks the path selection of vanguard circs. There is a TODO on the second unittest that we might want to test sooner than later, but it's not trivial to do it right now. To do these unittests we needed the following mods: - Make some functions STATIC. - Add some more fields to the big fake network nodes of test_entrynodes.c - Switch fake node nicknames to base32 (because base64 does not produce valid nicknames).
2018-05-01Bug 25870: Allow 4th hop of vanguard circuits to be the guard.Mike Perry
This prevents a malicious RP/IP from learning the guard node in the case that we are using only one (because we aren't using two guards, or because one of those two guards is temporarily down). This ensures the "strong" version of Property #6 from https://lists.torproject.org/pipermail/tor-dev/2018-April/013098.html (Information about the guard(s) does not leak to the website/RP at all).
2018-05-01Bug 25870: Prevent the creation of A - B - A vanguard sub-paths.Mike Perry
These paths are illegal in Tor and relays will reject them. We do this by using specific nodes in the exclude list (but ignore /16 and family).
2018-04-28Bug 25870: Allow the last hop in a vanguard circuit to be our guard.Mike Perry
The last hop in vanguard circuits can be an RP/IP/HSDir. Since vanguard circuits are at least 3 hops (sometimes 4) before this node, this change will not cause A - B - A paths.
2018-04-22Merge branch 'bug25691_033_again_squashed'Nick Mathewson
2018-04-22Rename node_has_descriptor() to node_has_any_descriptor()Nick Mathewson
Changing the name of this function should help keep us from misusing it when node_has_preferred_descriptor() would be more appropriate.
2018-04-22Use router_crn_flags in more places, to pass direct-connect flagNick Mathewson
In order to fix 25691 and 25692, we need to pass the "direct_conn" flag to more places -- particularly when choosing single-hop tunnels. The right way to do this involves having a couple more functions accept router_crn_flags_t, rather than a big list of boolean arguments. This commit also makes sure that choose_good_exit_server_general() honors the direct_conn flag, to fix 25691 and 25692.
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-13Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-12Refine extend_info_for_node's "enough info" check once again.Nick Mathewson
In d1874b433953f64, we adjusted this check so that we insist on using routerinfos for bridges. That's almost correct... but if we have a bridge that is also a regular relay, then we should use insist on its routerinfo when connecting to it as a bridge (directly), and be willing to use its microdescriptor when connecting to it elsewhere in our circuits. This bug is a likely cause of some (all?) of the (exit_ei == NULL) failures we've been seeing. Fixes bug 25691; bugfix on 0.3.3.4-alpha
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-04-05Merge remote-tracking branch 'public/split_relay_crypto'Nick Mathewson
2018-03-27Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-26Make extend_info_from_node() more picky about node contentsNick Mathewson
This update is needed to make it consistent with the behavior of node_awaiting_ipv6(), which doesn't believe in the addresses from routerinfos unless it actually plans to use those routerinfos. Fixes bug 25213; bugfix on b66b62fb7525cac1e1 in 0.3.3.1-alpha, which tightened up the definition of node_awaiting_ipv6().
2018-03-17Extract the cryptographic parts of crypt_path_t and or_circuit_t.Nick Mathewson
Additionally, this change extracts the functions that created and freed these elements. These structures had common "forward&reverse stream&digest" elements, but they were initialized and freed through cpath objects, and different parts of the code depended on them. Now all that code is extacted, and kept in relay_crypto.c
2018-02-16Remove the return value of node_get_prim_orport() and node_get_prim_dirport()Neel Chauhan
2018-02-15Merge remote-tracking branch 'ffmancera-1/bug18918'Nick Mathewson
2018-02-07Merge remote-tracking branch 'dgoulet/ticket25163_033_01'Nick Mathewson
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-06rephist: Stop tracking EXTEND attemptsDavid Goulet
This removes the code that tracks the extend attemps a client makes. We don't use it and it was only used to provide statistics on a SIGUSR1 from the rephist dump stats function. Part of #25163 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-24Clarify directory and ORPort checking functions.Fernando Fernandez Mancera
In order to make the OR and dir checking functions in router.c less confusing we renamed some functions and splitted consider_testing_reachability() into router_should_check_reachability() and router_do_reachability_checks(). Also we improved the documentation. Fixes #18918. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-19Add a "falls through" comment to make gcc happy.Nick Mathewson
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.