| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
(Doing this to prevent us having two structs with the same name.)
|
| |
|
|
|
|
|
| |
Based on designs in #1124.
Note that there is a TODO here about a hack I had to do to appease
the borrow checker.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
The key insights here are:
- That relay cell format and crypto protocols aren't orthogonal:
Once we have GCO, it will require V1.
- That we only need the actual functions for layer construction to
be generic; we don't need to proliferate generic parameters
everywhere.
- That the circuit::handshake module already does most of what we
want.
|
| |
|
|
|
|
| |
This lets us paramaterize types and functions by a particular relay cell
format. We use this e.g. to statically parameterize the cell crypto
functions, thereby removing some run-time branching in the hot path.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Prop 340:
https://spec.torproject.org/proposals/340-packed-and-fragmented.html
This updates the decoding API to support multiple versions of the relay
cell encoding, including the new encoding proposed in prop340 that
supports relay message packing and fragmentation.
This commit doesn't actually add support for that new encoding yet.
|
| |
|
|
|
|
|
|
|
| |
`tor_circmgr::Error::Protocol` will soon include an optional `UniqId`.
Since `Protocol` errors can be caused by pending circuits, we need to be
able to peek at their `UniqId`.
Part of #1297
|
| |\
| |
| |
| |
| |
| |
| | |
Several clean-ups around failures in incoming stream request handlers.
Closes #1190, #1189, and #1188
See merge request tpo/core/arti!1892
|
| | |
| |
| |
| | |
Closes #1190
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In theory, it might be better to just un-register the
IncomingStreamRequestHandler when the Receiver for the stream
requests is dropped. However, there are two reasons not to do so:
1. It's tricky. We never actually poll on the corresponding Sink,
so there isn't a place where the Reactor would expect to get a
prompt notification of closure. We only find out that the
Receiver has been dropped when an attempt to send on the Sink
returns an `is_disconnected` error.
2. It's unnecessary. In the Tor protocols, once we have decided to
accept incoming stream requests on a circuit, we want to continue
to do so until one of the parties closes the circuit.
I've documented this in several comments, in case whe want to get
fancier in the future.
Closes #1188.
|
| | |
| |
| |
| | |
Closes #1189.
|
| |/
|
|
|
|
| |
The bug described here was already fixed as #1065 via !1681.
Closes #1191.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
These are about making allow_incoming_streams give an error if a
handler is already installed.
I'm calling these non-MUST, since they don't affect the actual API
here, and we already have comments telling you not to do that. We
can add them later.
|
| | |
|
| |
|
|
|
|
|
| |
These comments are about internal representations and future extensions.
Also, add a fail-safe check to make sure that hop_num consistency is
enforced.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is pure renaming, done automatically with rust-analyzer.
Comment fixes and other cleanups will be in the subsequent commits.
We're doing this renaming because we need a name for
the combination of a `RelayMsg` and an `Option<StreamId>`
that we use when we have a `RelayMsg`
we intend to route to a given stream or circuit internally.
Previously we called this a `RelayCell`,
but that name was already somewhat inaccurate,
and will become _very_ inaccurate with the arrival of prop340,
which breaksthe 1:1 relationship between relay cells
and relay messages.
(If we didn't do this renaming now, we'd soon be making
the relationship between `UnparsedRelayCell`and `RelayCell`
many-to-many, which would be ridiculous and confusing.)
The `RelayMsgOuter` name is a placeholder:
We expect that we'll want to rename this type,
and may also want to rename `RelayMsg`,
and unify our vocabulary in other areas too.
But such a renaming will have to wait
for a larger discussion affecting the specifications,
so that we can use the same vocabulary everywhere.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| | |
This is in keeping with the behavior of C tor, and of
torspec!179.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
While looking for differences, we found that C tor always
omits the flags and the hostname from a BEGIN message sent on an
onion service circuit. In torspec!179, we specified that behavior.
This patch brings arti into conformance.
Closes #1077.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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 `StreamMap::terminate` no longer panics, and now that it
permits the kind of double-call that we allow, we can close #1065.
Closes #1065.
|
| |
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
The function never yields anything but an `Ok`, so we can
simplify its type.
(Not a stable feature, so no semver entry needed)
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
proto: new ClientCirc::send_raw_msg function.
Closes #1010
See merge request tpo/core/arti!1525
|
| | | |
|
| | |
| |
| |
| | |
Closes #1010.
|
| |/
|
|
|
| |
Nightly rustdoc now warns if you have a link that isn't necessary,
and if you have a link that might refer to two different things.
|
| |
|
|
|
|
|
| |
This adds a test that checks if the reactor is shut down if it receives
an incoming stream request from an unexpected hop.
Part of #1009
|
| |
|
|
|
|
|
|
|
|
| |
For consistency with the other `ClientCirc` APIs,
`ClientCirc::allow_stream_requests` now takes a `HopNum` argument. Upon
receiving an incoming stream request, the reactor now checks if the
request came from the hop specified in `allow_stream_requests` (and if
it came from a different hop, the circuit is closed).
Part of #1009
|
| | |
|