| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
| |
This patch refactors the internal representation of the TorPath type to
use an enum for representing its state. We add explicit constructor
methods to create the different types of path's, such that client users
can write code that uses different paths based on their need.
This work was done together with Nick as part of the Arti hackathon.
|
| |
|
|
|
|
| |
This is a somewhat obnoxious change in its scope and requirements,
but it makes it easier to understand what the real public and
private parts of our APIs are.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Rust 1.52 just came out, and there are new clippy lints to deal
with:
* It spots more cases when we could use Option::map
* It spots more cases when we could use Iterator::flatten
* When we build a struct instance, it wants us to list the fields
in the same order that the struct declares them.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Important refactoring happened recently which broke the
"experimental-api" feature.
Fixes are quite simple.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
|
|
|
|
| |
These lints force us to declare our exported enums and
exhaustive-looking structs as non-exhaustive (so that we can add to
them in the future without breaking our API) or to explicitly
disable the warning for a given enum/struct (to say that we _intend_
for additions to be a breaking change).
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This is a big change, but it is a step towards our goal of removing
tor_rtcompat:: calls directly.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Public function so an application can use to build a circuit using a
custom path.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
The major types are:
* You implemented Into when you should have implemented From.
* You sliced a slice when you didn't have to.
* You said Ok(x?) when you could have said x.
* You said Vec::new(); push(); push(); when you could have said vec![].
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This commit adds configuration options for these values, with the
right defaults, and uses those options instead of built-in functions
to set them.
We also remove the function to extract information from chutney
directories: now that arti is configurable, it can be chutney's job
to make its own network configurations.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
These necessitated a little complexity for our circuit
creation/extension API; we might want to refactor that down the
road.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We implement `Relay::in_same_family` which is in turn used by
`ExitPathBuilder::pick_path` to avoid picking relays in the
same family.
Compared to the original C implementation, we are missing
support for options EnforceDistinctSubnets and NodeFamilySets.
This has only been very lightly tested so far.
Closes: #43
|
| | |
|
| |
|
|
|
|
| |
We now have a way to tell a circuitmgr whether we require ipv4/ipv6
support for a target address in an exit policy, and we use similar
logic to set begin flags.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Notably, turn the hashmap into its own type. This will help with
other refactoring and fixes in the future.
Also notably, fix the code we use when a pending circuit is
complete. There's still a design flaw there though.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
We now use the unique id of each non-pending circuit as its key in
the map. I wish I could do this without copying, but I don't see a
great way to do that while keeping the pending entries in the same
map for now.
|
| |
|
|
|
|
|
|
| |
Previously we'd just remember the port that we _wanted_ a circuit
for, and forget all the ports that it _could_ support.
This is part of a bigger circmgr revision/refactoring pass; there
should be cleanups before I merge this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes a whole lot of our code simpler, and makes it so that
CircMgr and DirMgr no longer need to have anything parameterized
over transports, either.
Instead of boxing Transport inside of ChanMgr, I've made a new
Connection trait that goes from a ChanTarget* straight to a Channel.
This lets us avoid having to box the intermediate TLS object.
[*] Actually, a copy of the information from a ChanTarget. Ick, but
I had to make a copy to avoid parameterizing
Connecter::build_channel.
|
| | |
|
| |
|
|
|
|
| |
This patch fixes a minor typo in the error case when looking for a
middle relay for a 3-hop circuit where the error message should say "No
middle relay found" and not "No exit relay found".
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This adds two timeouts in total: one for sending begin, and getting
headers, and one for getting the rest of the data.
These timeouts are way too long right now, but at least the code is
there.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This is mainly a refactoring commit, with a little new code.
It also adds #[derive(Copy,Clone)] for a few types.
|
| |
|
|
| |
These have a FallbackDirectory as target, rather than a Relay.
|
| |
|
|
|
|
| |
This lets us have the notion of "get the first hop of a path as some
kind of a chantarget", which will make it easier to write other path
types.
|
| | |
|