| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We're not currently using any of the path builders outside of
`tor-circmgr`, so let's make them crate-private for now.
Care must be taken if/when we decide to make them public again. For
instance, the `HsPathBuilder` exposes two path building functions, one
that uses vanguards, and one that doesn't. We want to strongly encourage
the use of the vanguards-aware version of the function whenever the
`vanguards` feature is enabled, without breaking any of its existing
non-vanguard uses.
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2046#note_3010217
|
| |
|
|
|
|
|
|
| |
Instead of the `B: AnonymousPathBuilder` argument, `select_guard` now
takes separate arguments for the values it previously obtained by
calling the methods of `AnonymousPathBuilder`. This enables us to remove
the mostly unnecessary `AnonymousPathBuilder` implementation of
`VanguardHsPathBuilder`.
|
| |
|
|
|
| |
We're about to reuse this in the path selection with vanguards
implementation.
|
| |
|
|
|
| |
We will soon need this in `HsPathBuilder` (for building `TorPath`s that
consist of vanguards).
|
| | |
|
| |
|
|
| |
This enables us to make `AnonymousCircuitBuilder` private.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The `pick_path()` default implementation is an almost verbatim copy of
`ExitPathBuilder::pick_path()`. The only difference is that instead of
using values from `self`, the `AnonymousPathBuilder::pick_path()` uses
the values returned by the different `AnonymousPathBuilder` functions
(i.e., `AnonymousPathBuilder::pick_exit()` instead of
`self.pick_exit()`, `AnonymousPathBuilder::compatible_with()` instead of
`self.compatible_with`, etc.).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This lets us check long_lived_ports only when we are constructing
a TargetCircUsage, and lets us remember whether or not the circuit
we've built is suitable for non-long-lived ports.
It also lets us decide whether existing circuits are compatible with
new requests.
Closes #1100.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This threads the country codes work through the rest of the codebase:
- `tor-dirmgr` will now enable GeoIP with the embedded database when the
`geoip` future is enabled
- This can be extended later using the `DirMgrConfig` to allow
specifying a custom database; this is not done here, though
- `tor-circmgr`'s `SupportedCircUsage` and `TargetCircUsage` fields gain
new `country_code` members to allow filtering circuits by country
- These are `()` in builds where the `geoip` feature is not enabled --
doing it this way means we don't have to copy and paste huge swathes
of code, since we can't use `#[cfg]` in patterns
- `ExitPathBuilder` gains (hacked-in) support for choosing a relay with
the correct country code
- Due to the lack of conjuction, we just copy and paste a small bit,
pending further refactoring
- `StreamPrefs` now lets you specify a country code, letting embedders
make use of the feature
|
| | |
|
| |
|
|
| |
These are structure-internal things we can solve later, if ever.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously we could only use Relay for this case, which won't work
any more: a Bridge is not a `tor_netdir::Relay`. Instead we allow
the GuardMgr to give us something that knows how to convert itself
into an OwnedCircTarget.
This change required a far amount of follow-on revisions and
refactoring, but it should all be internal to the path-building
logic.
|
| |
|
|
|
| |
This method tells if two HasRelayIds contain exactly the same set of
Relay identities, and is generally useful for debugging.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want the set of identities supported by a relay to be extensible
in the future with minimal fuss; we'd also like to make working
with these ID sets more convenient. To handle that, this commit
adds a new trait for "Something that has the same IDs as a relay"
and a new object for "an owned representation of a relay's IDs."
This commit introduces a similar trait for "Something with a list of
SocketAddr, like a relay has." There's no owned equivelent for
that, since Vec<SocketAddr> is already a thing.
Closes #428.
|
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we're building a path with the guard manager involved, we now ask
the guard manager to pick our first hop no matter what. We only
pick from the fallback list ourselves if we're using the API with no
guard manager.
This causes some follow-on changes where we have to remember an
OwnedChanTarget object in a TorPath we've built, and where we gain
the ability to say we're building a path "from nothing extra at
all." Those are all internal to the crate, though.
Closes #220, by making sure that we use our guards to get a fresh
netdir (if we can) before falling back to any fallbacks, even if our
consensus is old.
Compilation should be fixed in the next commit.
|
| |
|
|
|
|
|
| |
This is the logical place for it, I think: the GuardMgr's job is to
pick the first hop for a circuit depending on remembered status for
possible first hops. Making this change will let us streamline the
code that interacts with these objects.
|
| |
|
|
|
|
|
|
| |
I wanted this while debugging something.
The ad-hoc impl Debug with f.debug_struct is getting repetitive
and I've already perpetrated one copy-paste mistake.
We should consider using something like the `educe` crate's Clone.
|
| |
|
|
| |
There are a couple of tricky ones I'll do separately.
|
| | |
|
| | |
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|