| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
|
|
|
|
|
| |
With this change, we will accept serialized RelayId representations
that omit one or more keys. This will eventually allow us to omit
absent keys when we serialize these.
This is the first stage of #2477.
|
| |
|
|
|
|
|
|
|
| |
This is used when we build an OwnedChanTarget using the builder. Instead
of going identities by identities at the callsite, we can use this
helper to get us a RelayIds builder and set it in the
OwnedChanTargetBuilder.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
|
|
| |
This will let us model the actual structure of routerstatus entries in
netdocs more closely. They don't have the addresses in a single list.
When this code was written this would have been much more awkward,
but now we have RPITIT.
|
| |
|
|
|
|
|
|
|
|
| |
This is important, since some circuits require us to negotiate a new
channel, and some don't: by adding this variability, we can easily
learn a timeout based on pre-existing channels to our guards, but
then later time out if it takes a while to open a TLS connection.
This is a possible solution to part of #2079, a bug where we "learn"
a circuit timeout that is too low for us to satisfy.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Formerly we would display just the first characters of the identity,
without telling you what kind of ID it was.
|
| | |
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
| |
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
|
| | |
|
| |
|
|
|
| |
This makes it easy to talk about, and construct, a
BoxSensitive<OwnedChanTarget>, which is what we'll use in errors.
|
| |\
| |
| |
| |
| | |
CircMgr: Refactor DirSpecificTarget constructor
See merge request tpo/core/arti!866
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit replaces the
`impl From<&T> for OwnedChanTarget where T:ChanTarget`
with a new `IntoOwnedChanTarget` trait. This lets us be explicit
that we're constructing an owned object, and not just converting
something.
No semver change needed, since these APIs haven't been released.
----------- (new description)
|
| | |
| |
| |
| |
| | |
Nothing used this; if anything wants it, it would be better off
calling `.display_chan_target()`.
|
| |/
|
|
|
|
|
|
|
|
| |
This change lets us display a ChanTarget's members without first
cloning them into an OwnedChanTarget.
It also resolves a reliability issue by outputting better info when
talking about connections via pluggable transports.
Closes #647
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Now it contains either an `OwnedChanTarget` or an `OwnedCircTarget`,
which will let `GuardMgr` return bridges that can be used to make
circuits.
As part of this change, it was necessary to revise some
address-modification functions that applied to filters and
`OwnedChanTarget`. Now they do the smart thing, and remove only the
address that are in the `ChanMethod`. This means that the addresses
from HasAddrs are still accurate about which addresses the relay
"has".
|
| |
|
|
|
|
|
| |
Now each `ChanTarget` has at most one `ChannelMethod`, and only
`Direct` `ChannelMethods` can have multiple addresses.
Closes #600.
|
| |
|
|
| |
These are now builders.
|
| |
|
|
|
| |
This will become the preferred way to make one of these objects, and
insulate us against future API changes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HasAddr used to mean "Here are addresses that I have, at which I can
be contacted." But "Where (and how) can I be contacted?" is now a
question for HasChannelMethod to answer.
(We still need to have "HasAddr", though, so we can answer things
like "what country is this relay in" and "are these relays in the
same /8?")
So this commit introduces:
* A new trait for adding an implementation of HasChannelMethod in
terms of HasAddr.
* A requirement on ChanTarget that it needs to implement
HasChannelMethod.
There is some temporary breakage here, marked with "TODO pt-client",
that I'll fix later in this branch.
|
| |
|
|
| |
We'll need to sort these out as we implement pluggable transports.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change, each individual identity type becomes optional.
The functions that expose them unconditionally are now in a "legacy"
trait that only some downstream types are expected to implement.
There are new convenience APIs in HasRelayIds:
* to return Option<&keytype>,
* to see if one identity-set contains another.
This commit will break several downstream crates! For the
reviewer's convenience, I will put the fixes for those crates into a
series of squash! commits on this one.
tor-netdir
----------
Revise tor-netdir to accept optional identities. This required some
caveats and workarounds about the cases where we have to deal with a
key type that the tor-netdir code does not currently recognize at
all. If we start to add more identity types in the future, we may
well want more internal indices in this code.
tor-proto
---------
In order to make tor-proto support optional identities, there were
fewer changes than I thought. Some "check" functions needed to start
looking at "all the ids we want" rather than at "the two known IDs";
they also needed to accommodate that case where we don't have an ID
that we demand.
This change will also help with bridges, since we want to be able to
connect to a bridge without knowing all of its IDs up front.
The protocol currently _requires_ the two current ID types in some
places. To deal with that, I added a new `MissingId` error.
I also removed a couple of unconditional identity accessors for
chanmgr; code should use `target().identity(...)` instead.
tor-chanmgr
-----------
This is an incomplete conversion: it does not at all handle channel
targets without Ed25519 identities yet. It still uses those
identities to index its internal map from identity to channel; but
it gives a new `MissingId` error type if it's given a channel target
that doesn't have one.
We'll want to revise the map type again down the road when we
implement bridges, but I'd rather not step on the channel-padding
work in progress right now.
tor-guardmgr
------------
This change is mostly a matter of constructing owned identity types
more sensibly, rather than unwrapping them directly.
There are some places marked with TODOs where we still depend on
particular identity types, because of how the directory protocol
works. This will need revisiting when we add bridge support here.
tor-circmgr
-----------
These changes are just relatively simple API changes in the tests.
|
| |
|
|
|
| |
This method tells if two HasRelayIds contain exactly the same set of
Relay identities, and is generally useful for debugging.
|
| |
|
|
|
| |
This will allow RelayIds to replace IdPair in tor-guardmgr. (The
fields are named accordingly with `serde(rename)`.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Even when keys are relevant, we still don't want to attribute errors
to a set of addresses when we have a single address that we're
connected with.
|
| | |
|
| |
|
|
|
|
|
| |
The redundant method was a `to_owned` that probably shouldn't have
been called that. It was only used in one place.
The tests should get tor-linkspec's line coverage up above 90%.
|
| | |
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|