summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.h
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-01Extract various enums and tiny structs from or.hNick Mathewson
These all have a logical header to go in.
2018-07-01Minimize headers that include crypto_formats and x25519 stuffNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
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-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-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-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.
2017-12-08Merge remote-tracking branch 'mikeperry/bug23114_squashed2'Nick Mathewson
2017-12-08Fix wide lines introduced by previous patch.Nick Mathewson
2017-12-08Replace all FREE_AND_NULL* uses to take a type and a free function.Nick Mathewson
This commit was made mechanically by this perl script: \#!/usr/bin/perl -w -i -p next if /^#define FREE_AND_NULL/; s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/; s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;
2017-12-08Update free functions into macros: src/or/ part 1Nick Mathewson
This covers addressmap.h (no change needed) through confparse.h
2017-12-07Bug #23100: Count all 3 hop circuits for CBT.Mike Perry
This change causes us to count anything once it reaches 3 hops (but not after).
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-07-07Explicit length checks in circuit_init_cpath_crypto().George Kadianakis
2017-07-07test: Crypto groundwork for e2e circuit unittests.George Kadianakis
- Move some crypto structures so that they are visible by tests. - Introduce a func to count number of hops in cpath which will be used by the tests. - Mark a function as mockable.
2017-07-07Refactor circuit_init_cpath_crypto() to do prop224 rend circuits.George Kadianakis
circuit_init_cpath_crypto() is responsible for creating the cpath of legacy SHA1/AES128 circuits currently. We want to use it for prop224 circuits, so we refactor it to create circuits with SHA3-256 and AES256 as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-03Add tests for new_route_len()Taylor Yu
2017-03-15Run the copyright update script.Nick Mathewson
2016-12-16Merge branch 'prop271_030_v1_squashed'Nick Mathewson
2016-12-16Implement support for per-circuit guard restrictions.Nick Mathewson
This is an important thing I hadn't considered when writing prop271: sometimes you have to restrict what guard you use for a particular circuit. Most frequently, that would be because you plan to use a certain node as your exit, and so you can't choose that for your guard. This change means that the upgrade-waiting-circuits algorithm needs a slight tweak too: circuit A cannot block circuit B from upgrading if circuit B needs to follow a restriction that circuit A does not follow.
2016-12-08Merge branch 'feature15056_v1_squashed'Nick Mathewson
2016-11-30Use the new guard notification/selection APIs throughout TorNick Mathewson
This patch doesn't cover every case; omitted cases are marked with "XXXX prop271", as usual. It leaves both the old interface and the new interface for guard status notification, since they don't actually work in the same way: the new API wants to be told when a circuit has failed or succeeded, whereas the old API wants to know when a channel has failed or succeeded. I ran into some trouble with directory guard stuff, since when we pick the directory guard, we don't actually have a circuit to associate it with. I solved that by allowing guard states to be associated with directory connections, not just circuits.
2016-11-30Write the easy parts of the public entryguard interface.Nick Mathewson
Here we add a little bit of state to origin circuits, and set up the necessary functions for the circuit code to call in order to find guards, use guards, and decide when circuits can be used. There's also an incomplete function for the hard part of the circuit-maintenance code, where we figure out whether any waiting guards are ready to become usable. (This patch finally uses the handle.c code to make safe handles to entry_guard_t objects, so that we are allowed to free an entry_guard_t without checking whether any origin_circuit_t is holding a reference to it.)
2016-11-24Refactor circuit_predict_and_launch_newChelsea H. Komlo
2016-11-10Add an ed25519 identity to extend_infoNick Mathewson
2016-08-24Client & HS ignore UseNTorHandshake, all non-HS handshakes use ntorteor (Tim Wilson-Brown)
Rely on onion_populate_cpath to check that we're only using TAP for the rare hidden service cases. Check and log if handshakes only support TAP when they should support ntor.
2016-08-24Client & HS make sure every hop in every non-HS path supports ntorteor (Tim Wilson-Brown)
When a client connects to an intro point not in the client's consensus, or a hidden service connects to a rend point not in the hidden service's consensus, we are stuck with using TAP, because there is no ntor link specifier.
2016-03-11Merge remote-tracking branch 'teor/bug8976_01_028'Nick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
2015-12-08Don't allow a rendezvous point to have a private addressDavid Goulet
When an HS process an INTRODUCE2 cell, we didn't validate if the IP address of the rendezvous point was a local address. If it's the case, we end up wasting resources by trying to extend to a local address which fails since we do not allow that in circuit_extend(). This commit now rejects a rendezvous point that has a local address once seen at the hidden service side unless ExtendAllowPrivateAddresses is set. Fixes #8976 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-02-11fix a compilation warningNick Mathewson
2015-02-11Merge branch 'bug12844'Nick Mathewson
Conflicts: src/or/circuituse.c src/test/include.am src/test/test_entrynodes.c
2015-01-23whitespace fixesNick Mathewson
2015-01-07When closing circs build through a new guard, only close local onesNick Mathewson
If we decide not to use a new guard because we want to retry older guards, only close the locally-originating circuits passing through that guard. Previously we would close all the circuits. Fixes bug 9819; bugfix on 0.2.1.1-alpha. Reported by "skruffy".
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-15Implement Tor2webRendezvousPoints functionality.George Kadianakis
2014-05-07Basic tests for get_unique_circ_id_by_chan.Nick Mathewson
2013-10-31Move pathbias functions into a new file.Nick Mathewson
Does not compile yet. This is the "no code changed" diff.
2013-02-19Downgrade an assert to LD_BUGNick Mathewson
This should prevent crashes on further recurrence of 8065, and help diagnose such if they occur
2013-02-01Refactor code that rolls back the use stateMike Perry
Also document it better. Mention this refactoring in the comments for the path state machine.
2013-01-18Implement Path use bias accounting.Mike Perry
Path use bias measures how often we can actually succeed using the circuits we actually try to use. It is a subset of path bias accounting, but it is computed as a separate statistic because the rate of client circuit use may vary depending on use case.
2013-01-16Update the copyright date to 201.Nick Mathewson
2013-01-08Bug 7691 review fixes.Mike Perry
Also add in the random nonce generation.
2013-01-08Bug 7691: Send a probe cell down certain types of circs.Mike Perry
In general, if we tried to use a circ for a stream, but then decided to place that stream on a different circuit, we need to probe the original circuit before deciding it was a "success". We also need to do the same for cannibalized circuits that go unused.
2013-01-03Merge branch 'ntor-resquashed'Nick Mathewson
Conflicts: src/or/cpuworker.c src/or/or.h src/test/bench.c
2013-01-03Enable the ntor handshake on the client side.Nick Mathewson
"works for me"