| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Peraonally I would prefer
| #![cfg_attr(not(all(feature = "full", feature = "experimental")),
| allow(dead_code))]
but I think that is almost certainly controversial.
See tpo/core/arti#704.
|
| |
|
|
|
| |
As per this comment, and preceding discussion
https://gitlab.torproject.org/tpo/core/arti/-/issues/1060#note_2959187
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This changes the internal representation to be `NonZeroU32` instead of
just `u32`.
Various places where a circuit ID is optional now use `Option<CircId>`.
Fixes a bug in `CircIdRange::sample` that would previously return a
circuit ID of 0, when the rng returned 0x8000_0000 for a low range.
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Refactor the stream-closing logic in tor-proto
Closes #1065
See merge request tpo/core/arti!1681
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Because dropping a `StreamTarget` causes the circuit reactor to send
an End, the previous do-nothing implementation of `discard()` wasn't
sufficient to cause the request to be ignored without sending an
End.
This commit modifies our "close pending stream" behavior to only
optionally send an End message. To avoid confusion, I'm using a new
`CloseStreamBehavior` enum rather than an `Option<End>`, since we
had previously used `None` in some cases to indicate a default
(misc) end message.
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
Now that every state-change function consumes the IncomingStream,
there is no longer any reason to keep track of an internal state
enum.
|
| | | |
|
| | |
| |
| |
| |
| | |
Now that IncomingStream doesn't implement Drop, we can just
destructure it.
|
| | |
| |
| |
| |
| | |
Since dropping a StreamTarget will send an End, we don't need
to call reject_internal in this case.
|
| | |
| |
| |
| |
| |
| |
| | |
Now that `StreamMap::terminate` no longer panics, and now that it
permits the kind of double-call that we allow, we can close #1065.
Closes #1065.
|
| | |
| |
| |
| |
| | |
The rule is that we allow up to one explicit `close_pending`,
followed by exactly one final `mpsc::Sender` drop.
|
| | |
| |
| |
| |
| | |
We will use this to enforce correct ordering on "close" vs "drop"
APIs.
|
| |\ \
| |/
|/|
| |
| | |
Upgrade several dependencies.
See merge request tpo/core/arti!1680
|
| | | |
|
| | |
| |
| |
| | |
See #1065 for more information here.
|
| |/
|
|
|
|
|
|
|
| |
It turns out that we can make `IncomingStream::reject()` consume
self, thus making it impossible to hit the double-close error
from outside the `tor-proto` crate.
Also, we rename `StreamTarget::close()` to `close_pending()` to
better reflect its limited applicability.
|
| |\
| |
| |
| |
| | |
tor-proto: Resolve a few TODO HSS entries.
See merge request tpo/core/arti!1658
|
| | |
| |
| |
| |
| | |
This should be smaller and faster than vec, and save some
allocations. It could also avoid a tiny sidechannel.
|
| | | |
|
| | |
| |
| |
| | |
This will let avoid some copying inside our HSS code.
|
| | |
| |
| |
| |
| | |
There is some similarity, but there's not really a logical way
to combine the two that actually results in less, clearer code.
|
| | | |
|
| |/ |
|
| |
|
|
| |
cargo fmt, precisely.
|
| | |
|
| |\
| |
| |
| |
| | |
tor-proto: Refactor the key derivation
See merge request tpo/core/arti!1629
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit refactors the key derivation, by applying the following:
- The spaghetti slice creation with the hard-to-read boundaries got
replaced by a closure, which accepts a length, advances the seed slice
by n bytes as a side-effect, and returns the just advanced bytes
- The use of `.except` got replaced by an `.or`, with the use of the
already existing `InvalidKDFOutputLength` error, thereby removing a
potential panic (probably not reachable in runtime though)
- The conversion from a slice to a `CircuitBinding` got moved into a
`TryFrom` trait of the appropriate data structure
|
| |/ |
|
| |\
| |
| |
| |
| | |
Upgrade several dependencies
See merge request tpo/core/arti!1626
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of tying ourselves to a particular version of the
generic-array crate, we now always use the version re-exported by
our RustCrypto crates. This lets us avoid the possibility of
version mismatch.
(Originally I had planned to upgrade to generic-array 1.0, but then
I found that we were not actually using it.)
|
| |/
|
|
|
|
|
|
|
| |
This commit replaces a repeating code pattern in the `set_digest`
function for setting the 'Recognized' and Digest field to zero with a
slice fillment.
Besides this, it also adds comments explaining which fields are
currently getting zeroized.
|
| |
|
|
|
|
|
| |
The function never yields anything but an `Ok`, so we can
simplify its type.
(Not a stable feature, so no semver entry needed)
|
| |\
| |
| |
| |
| |
| |
| | |
Accept and transmit padding in introduce2 plaintexts
Closes #1031
See merge request tpo/core/arti!1602
|
| | |
| |
| |
| |
| |
| | |
Closes #1031. This padding ensures that the introduction point
doesn't learn the length of the plaintext being sent to the onion
service.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Since we are using the same introduction point circuits for multiple
time periods, we need the ability to provide a set of subcredentials
and see which of them acually works. Fortunately, we "only" have to
do digest operations here, which are much faster than public key.
|
| |/ |
|
| |
|
|
|
| |
Fixes
cargo clippy -p tor-hsclient --all-features --all-targets
|
| | |
|
| | |
|
| |
|
|
|
| |
This removes the `Display` impl of `HopNum` and replaces its usage with
`HopNum::display`.
|
| |
|
|
|
|
|
|
|
| |
This function can be used to display a more user-friendly representation
of a `HopNum`. This will print hop numbers as 1-indexed values: #1,
#2, etc..
We will soon remove HopNum's Display implementation in favour of
`.display()`.
|
| |
|
|
|
|
|
|
|
|
| |
This makes `HopNum`s display as 1-indexed values. This will make error
messages more intuitive, because when talking about an N-hop circuit, we
generally speak in terms of hops 1..N (rather than 0..N-1).
Internally, our `HopNum` indices are still 0-based.
Closes #996
|