aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitbuild.c
AgeCommit message (Collapse)Author
2021-07-12Service intro circuits are now 4-hop to avoid linkability by introGeorge Kadianakis
Now the circuits look like this: client rend: C -> G -> L2 -> Rend client intro: C -> G -> L2 -> M -> Intro client hsdir: C -> G -> L2 -> M -> HSDir service rend: C -> G -> L2 -> M -> Rend service intro: C -> G -> L2 -> M -> Intro service hsdir: C -> G -> L2 -> M -> HSDir
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2020-09-18Add flag for whether an OR conn "counts" for bootstrap trackingNick Mathewson
We set this flag if we've launched the connection in order to satisfy an origin circuit, or when we decide the connection _would_ satisfy an origin circuit. These are the only or_connections we want to consider for bootstrapping: other or_connections are opened because of client EXTEND requests, and they may succeed or fail because of the clients' confusion or misconfiguration. Closes #25061.
2020-07-16Collapse channel_get_*_remote_addr() into a single function.Nick Mathewson
Since we can list the real address and the canonical one in a human-readable format we don't need to pick.
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-02Allow multiple addresses in extend_info_t.Nick Mathewson
In practice, there will be at most one ipv4 address and ipv6 address for now, but this code is designed to not care which address is which until forced to do so. This patch does not yet actually create extend_info_t objects with multiple addresses. Closes #34069.
2020-07-02Refactor channel_connect_for_circuit() to take an extend_info_t.Nick Mathewson
2020-06-22Add circuit_extend_add_ipv(4/6)_helper() testNeel Chauhan
2020-05-18nodelist: Replace int with boolteor
Make some interfaces and implementations consistent by replacing int with bool. Part of 34200.
2020-05-15test/circuitbuild: Tests for node selection flagsteor
Part of 33222.
2020-05-14circuitbuild: test relays sending IPv6 extend cellsteor
Add tests for relays sending IPv6 extend cells in circuit_send_next_onion_skin(). Clients also use this code, check that they can only extend over IPv4 (for now). Part of 33222.
2020-05-13test/circuitbuild: Add a test for origin_circuit_init()teor
Part of 33222.
2020-04-30relay: Refactor can extend over IPv6 checksteor
Split "can extend over IPv6" and "has advertised IPv6 ORPort" into separate functions. They currently have the same result, but this may change in 33818 with ExtendAllowIPv6Addresses. Part of 33817.
2020-04-29relay: Add tests for choosing extend IPsteor
Part of 33817.
2020-04-29relay: Add IP version tests for circuit extendsteor
Add IPv4-only and IPv6-only tests for circuit_open_connection_for_extend(). Part of 33817.
2020-04-29relay: Choose between IPv4 and IPv6 extends at randomteor
When an EXTEND2 cell has an IPv4 and an IPv6 address, choose one of them uniformly at random. Part of 33817.
2020-04-29test/circuitbuild: Disable some tests when ALL_BUGS_ARE_FATALteor
Some tests use IF_BUG_ONCE(), which is fatal when ALL_BUGS_ARE_FATAL, after the fixes in 33917. Also run "make autostyle" on these changes. Part of 33817.
2020-04-29relay/circuitbuild: Re-use IPv6 connections for circuitsteor
Search for existing connections using the remote IPv4 and IPv6 addresses. Part of 33817.
2020-04-29relay/circuitbuild: Consider IPv6-only extends validteor
Allow extend cells with IPv6-only link specifiers. Warn and fail if both IPv4 and IPv6 are invalid. Also warn if the IPv4 or IPv6 addresses are unexpectedly internal, but continue with the valid address. Part of 33817.
2020-04-29test/circuitbuild: Show bad addresses in some logsteor
Disable SafeLogging for some extend tests, so we can check the actual addresses. Part of 33817.
2020-04-29relay: Log the address in circuit protocol warningsteor
Always log the address family in extend protocol warnings. If SafeLogging is 0, also log the address and port. Diagnostics for 33817.
2020-04-29Run "make autostyle"teor
2020-04-09test/circuitbuild: Add a test for onionskin_answer()teor
Part of 33633.
2020-04-09test/circuitbuild: Add tests for circuit_extend()teor
Part of 33633.
2020-04-09test/circuitbuild: Add tests for open_connection_for_extendteor
Part of 33633.
2020-04-09test/circuitbuild: Add tests for extend_lspec_validteor
Part of 33633.
2020-04-09test/circuitbuild: Make some tests forkteor
Since we're testing IF_BUG_ONCE(), we need to fork. Part of 33633.
2020-04-09test/circuitbuild: Tests for adding ed25519 keysteor
Add tests for circuit_extend_add_ed25519_helper(). Part of 33633.
2020-04-09test/circuitbuild: Add a test for extend_state_validteor
Part of 33633.
2020-04-09test/circuitbuid: Fix new_route_len_unhandled_exitteor
Make test_new_route_len_unhandled_exit more robust, by always tearing down logs. (Rather than just tearing them down on success.)
2020-04-09test/circuitbuild: Refactor test case arrayteor
Avoid repeating test names. Part of 33633.
2020-03-19coverity: Silence spurious unreachable warningteor
Closes bug 33641; not in any released version of tor.
2020-03-06Skip test_new_route_len_unhandled_exit() when ALL_BUGS_ARE_FATALrl1987
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-08-19Fix a memory-leak warning in test_circuitbuid.cNick Mathewson
Coverity wants us to free everything that we are potentially allocating, even stuff where allocating it would be a bug. Adding a smartlist_free() here will fix the warning. Fixes bug 31452; bugfix on 16a0b7ed6779bf72a8a471c, which is not in any released Tor. This is CID 1447292.
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-04-26Make nodelist_get_list() return a const pointer.Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-11-05In count_acceptable_nodes(), count direct and indirect nodes with ↵Neel Chauhan
node_has_preferred_descriptor()
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-01Extract more constants from or.hNick 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
2017-04-03Capture expected log in test_circuitbuild.cTaylor Yu
Capture the warning for the unhandled circuit purpose test case, both to clean up the test log and to confirm that it gets logged.
2017-04-03Test unhandled purpose in route_len_for_purpose()Taylor Yu
Check that route_len_for_purpose() (helper for new_route_len()) correctly fails a non-fatal bug assertion if it encounters an unhandled circuit purpose when it is called with exit node info.
2017-04-03Add tests for new_route_len()Taylor Yu