| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
and propagate to other affected crates
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Fix clippy nightly again
See merge request tpo/core/arti!603
|
| | |
| |
| |
| |
| |
| | |
Found these by disabling the nightly dbg macro special case. Now, we
have a mechanism for globally adding suppressions to tests, we can use
that instead.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Some of these were for decoding particular objects (we now say
what kind of objects), and some were unrelated tor_cert errors that
for some reason we had shoved into a tor_bytes::Error.
There is now a separate tor_cert::CertError type, independent from
tor_cert's use of `tor_bytes::Error` for parsing errors.
|
| | |
| |
| |
| |
| |
| | |
Failing to encode is fundamentally different from failing to
decode. We now treat those separately, and describe _what_ we failed
to encode or decode.
|
| |/
|
|
|
| |
This avoids adding additional information for now; that will come on
the next commits.
|
| |
|
|
| |
Consequential ordering changes.
|
| |
|
|
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2814276
Change names and comments and docs everywhere.
|
| | |
|
| | |
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813565
|
| | |
|
| |
|
|
| |
Nothing geenrates config updates yet.
|
| |
|
|
| |
Nothing calls this yet.
|
| |
|
|
| |
It turns out that we are going to want this.
|
| |
|
|
|
| |
We're about to split the main new() function off so write a separate
test for new_disabled().
|
| |
|
|
| |
chanmgr is going to want to make one of these from a NetDir.
|
| |\
| |
| |
| |
| | |
Use impl_standard_builder more and remove manual Default/builder impls
See merge request tpo/core/arti!594
|
| | | |
|
| |/
|
|
|
| |
There is not, apparently, an eprintln equivalent for
allow-dbg-in-tests.
|
| | |
|
| |
|
|
| |
There aren't very many.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Plumb a SleepProvider (now Clone + ....) into Channel
See merge request tpo/core/arti!569
|
| | |
| |
| |
| |
| | |
The channel reactor is going to want to be able to sleep so that it
can do padding, so it needs a SleepProvider.
|
| |/
|
|
|
|
| |
This only affects uses of thread_rng(), and affects them all more or
less indiscriminately. One test does not work with
ARTI_TEST_PRNG=deterministic; the next commit will fix it.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a general-purpose implementation of the ad-hoc approach
currently taken in (eg) crates/tor-proto/src/channel/reactor.rs,
with an API intended to defned against the more obvious mistakes.
This allows us to separate the two concerns: the channel reactor can
focus on handling channel cells and control messages and is over 2.5x
shorter.
The complexity of the manual sink implementation, and the machinery
needed to avoid having to suspend while holding an item, are dealt
with separately. That separate implemenation now has proper
documentation. (Tests are in the nest commit to avoid this one being
even more unwieldy.)
We use `extend` to define this as an extension trait. A competitor is
`ext` but in my personal projects I have found `extend` slightly
better.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The type of ret.map_err(codec_err_to_chan)? is (). ISTM that
writing `let () = ` makes it clear that there is nothing there,
but the lint forbids this.
This lint is warn by default and trips here for me on current nightly.
It seems wrong to me. We should be able to make it clear to the
reader that there is nothing here - note how this differs from the
lines below where Ready contains msg. A let () binding is a good way
to do that.
I think the lint allow ought to be added everywhere, but that doesn't
seem easy right now - see this issue about maint/add_warning:
https://gitlab.torproject.org/tpo/core/arti/-/issues/469
|
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| | |
|
| |
|
|
|
|
|
|
| |
Fortunately, we don't need a separate type here: authenticated
clock skew can only come attached to a `tor_proto::Error`.
We also remove skew from `tor_proto::Error::HandshakeCertsExpired`,
since it would now be redundant.
|
| |
|
|
|
|
|
|
| |
of a channel.
At first I wanted to have this information not be a part of channels
at all, but it is a fairly tiny amount of data, and the alternatives
are pretty crufty.
|
| |\
| |
| |
| |
| | |
tor-proto: add the ability to learn clock skew from NETINFO cells
See merge request tpo/core/arti!410
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We now check the handshake certificates unconditionally, and only
report them as _expired_ as a last resort.
(Rationale: if somebody is presenting the wrong identity from a year
ago, it is more interesting that they are presenting the wrong ID
than it is that they are doing so with an expired cert.
We also now report a different error if the certificate is expired,
but its expiration is within the range of reported clock skew.
(Rationale: it's helpful to distinguish this case, so that we can
blame the failure on possible clock skew rather than definitely
attributing it to a misbehaving relay.)
Part of #405.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NETINFO cells, which are sent in every handshake, may contain
timestamps. This patch adds an accessor for the timestamp in the
Netinfo messages, and teaches the tor-proto code how to compute the
minimum clock skew in the code.
The computation isn't terribly precise, but it doesn't need to be:
Tor should work fine if your clock is accurate to within a few
hours.
This patch also notes a Y2038 problem in the protocol: see
torspec#80.
Part of #405.
|
| |/
|
|
|
|
|
|
|
| |
Each channel now remembers an OwnedChanTarget.
Each circuit now remembers a vector of OwnedChanTarget to represent
the path that it was constructed for.
Part of #415.
|
| |
|
|
| |
it's making rust-nightly job fail
|
| |
|
|
|
| |
Remove default conversion; instead use a specific conversion in each
of the two modules that need to do it.
|
| |
|
|
|
|
|
|
| |
This helps the user distinguish between protocol violations that
happen when connecting to the tor network from those that happen
while connected.
Closes #358.
|
| |
|
|
| |
(We'll have a BadChanHandshake soon.)
|
| |
|
|
|
|
|
| |
We want to distinguish handshake failures from errors later on in
the channel's lifetime.
Closes #359.
|