summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/circuit.rs
Commit message (Collapse)AuthorAgeFilesLines
* proto: ClientCirc: remove now-obsolete note on Clone-nessNick Mathewson2023-06-281-5/+0
|
* proto: document ClientCirc lifecycle better.Nick Mathewson2023-06-281-0/+29
|
* proto: Remove support for receiving unauthenticated SENDMEsNick Mathewson2023-06-261-10/+0
| | | | | | | We haven't generated these since Tor 0.3.5, which is no longer supported on the network. Closes #914.
* Merge branch 'proto-better-path' into 'main'Nick Mathewson2023-06-221-26/+73
|\ | | | | | | | | | | | | Better API for getting circuit paths Closes #787 See merge request tpo/core/arti!1286
| * proto: Resolve/downgrade some path-related "TODO HS" itemsNick Mathewson2023-06-221-2/+0
| |
| * proto: Add ClientCirc::path_ref(), deprecate path().Nick Mathewson2023-06-221-13/+35
| | | | | | | | | | | | | | | | The new path_ref() method returns an Arc<Path>, which gives a much better API for reasons discussed in the new documentation of path(). (We could just replace path() if we'd prefer, but IMO having path_ref() here isn't so bad.)
| * proto: Expose an opaque PathEntry.Nick Mathewson2023-06-221-5/+7
| | | | | | | | | | | | The new PathEntry struct wraps the old PathEntry enum, which has been renamed to HopDetail. It's an opaque struct because we want to be able to put new information in the enum as we think best.
| * proto: Make Path publicNick Mathewson2023-06-221-0/+2
| | | | | | | | (You can't get one yet or do much with it.)
| * proto: Remove Mutex from Path.Nick Mathewson2023-06-221-0/+4
| | | | | | | | | | Now Path is a regular struct with no interior mutability, and we use Arc::make_mut() for the case when we need to add a hop.
| * proto: Move Path into a separate shared mutable structureNick Mathewson2023-06-221-7/+26
| | | | | | | | (We're about to remove the interior mutability from Path.)
* | proto: downgrade some "TODO HS" comments to "HSS"Nick Mathewson2023-06-211-3/+3
|/ | | | | These are all related to issues that will come up for the service side of the onion service implementation.
* Apply 1 suggestion(s) to 1 file(s)Ian Jackson2023-06-121-1/+1
|
* proto: Have send_control_message take an AnyRelayMsg.Nick Mathewson2023-06-091-4/+2
| | | | | | | | | | When we break the 1:1 relationship of message and cell, we'll want this API to take messages, not cells. This API is experimental, so we don't need to call it a semver break. Closes #881.
* proto: Correct the docs on send_control_messageNick Mathewson2023-06-091-2/+7
| | | | | | | | Formerly we said that it would not return until the handler was uninstalled. This is incorrect: it returns as soon as the message is sent and the handler installed. Closes #885.
* Fix a silly clippy warningIan Jackson2023-06-081-0/+1
| | | | | Fixes nailing-cargo +stable clippy -p tor-hsclient --all-features --all-targets
* tor-circmgr: send_control_message: Add reference to MR discussionIan Jackson2023-06-051-0/+2
|
* tor-circmgr: send_control_message: API change proposalIan Jackson2023-06-051-0/+21
| | | | | | I am hoping we can merge this as a "TODO (Diziet)", even though I think it may be controversial. Ie merging this doesn't represent a decision to do as I suggest.
* tor-circmgr: send_control_message: Clarify some corner casesIan Jackson2023-06-051-7/+32
| | | | | | | | | | | | Also, no longer talk about handlers being "installed". That's not something that's exposed by this API. And, say that `send_control_message` can be called again only after *`send_control_message`* returns, not when `handle_msg` has returned `UinstallHandler`. IMO this makes more sense. Explain that we can't maintain a continuous watch while holding a conversation with the peer. (This is surely an API bug.)
* proto: Make PathEntry::Virtual feature-conditional.Nick Mathewson2023-05-231-0/+2
| | | | | This fixes a warning when building tor-proto without the `rpc-common` feature.
* proto: Explain "virtual" hops better.Nick Mathewson2023-05-181-0/+4
| | | | Based on text from @diziet
* proto: Allow circuit Paths to represent virtual hops.Nick Mathewson2023-05-181-3/+21
| | | | | Sadly, this adds a few more `TODO HS` entries, but I think we can clean them up later after a bit of discussion.
* proto: Implement Circuit::extend_virtual.Nick Mathewson2023-05-181-2/+17
| | | | | | | There are a few new TODO hs comments, though, and an XXXX I'll need to fix up in the next commit. Implements #726.
* tor-proto: Code to construct crypto layers for virtual hops.Nick Mathewson2023-05-181-0/+2
| | | | | This is fairly straightforward, thanks to our existing design work on this code.
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-17/+21
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.
* Change CircTarget::linkspecs() to return an encoded list.Nick Mathewson2023-05-101-4/+6
| | | | | | | | If we didn't do this, we would need to transfrom `EncodedLinkSpec`s into a `LinkSpec::Unrecognized`, which is not semantically right. What's more, every user of this API wants to consume encoded link specifiers, so encoding them early saves a little effort.
* tor-proto: Be explicit about an into().Nick Mathewson2023-04-121-1/+1
| | | | | | | This is a workaround for an issue that I'm about to encounter somewhere in our pile of dependencies as I add arti-rpcserver, and somehow make serde_json visible in this test code thereby, making the PartialEq method resolution ambiguous.
* Add an experimental circuit accessor to DataStream.Nick Mathewson2023-03-231-0/+6
| | | | Closes #784.
* tor-proto: Split off send-control-msg featureIan Jackson2023-03-231-4/+4
|
* tor-proto: document deep-copy in ClientCirc::path()Nick Mathewson2023-03-221-0/+4
|
* proto: Stabilize ClientCirc::n_hops.Nick Mathewson2023-03-221-1/+6
|
* tor-proto: Document limitation on send_control_messageNick Mathewson2023-03-081-0/+7
|
* tor-proto: Make send_control_message wait for the reactor.Nick Mathewson2023-03-081-2/+7
| | | | | This way we don't need to worry about race conditions that happen if the caller thinks that the handler is installed before it really is.
* tor-proto: Have send_control_message install a handler, not return a streamNick Mathewson2023-03-081-7/+8
|
* tor-proto: Implement functionality to send a message and accept repliesNick Mathewson2023-03-081-47/+44
| | | | | | | | | | | This new function combines "sending a message" and "accepting replies in a stream" into a single call, so that there is no gap between when the message is sent and the replies are available. There are a number of compromises here, in order to avoid API proliferation. I've tried to contain them as best I can. See comments for additional design discussion.
* tor-proto: Give Path a method to access final hop num.Nick Mathewson2023-03-081-10/+6
|
* tor-proto: Give circ Reactor a constructor, and make its fields private.Nick Mathewson2023-03-081-18/+2
|
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-281-3/+3
| | | | Fixes #756
* Use CmdChecker in our stream handling code.Nick Mathewson2023-02-171-3/+12
| | | | | | | | | | This change makes sure that open streams and half-closed streams have the same stream-type-dependent state machines with respect to which cells are acceptable. Fixes #774. Fixes #769.
* tor-proto: note implications for future HS workNick Mathewson2023-02-151-0/+10
|
* tor-proto: defer meta-cell parsing to the last moment.Nick Mathewson2023-02-151-3/+4
|
* tor-cell: Refactor relay cells to copy much lessNick Mathewson2023-02-151-5/+4
| | | | | | | | | | | | | We now manipulate raw relay cell bodies as (an alias for) `Box<[u8;509]>` rather than as (an alias for) `[u8;509]`. This enables us to do much less copying. It will become more important soon, as we defer parsing relay cell bodies even longer. Related to #7. We also use SliceWriter to avoid allocating a Vec<> for every relay message we want to encode, and instead encode directly into the cell.
* Rename OpenClientChan{Msg,Cell} => OpenChan{Msg,Cell}S2CNick Mathewson2023-02-091-3/+3
|
* tor-proto: Do not parse forbidden commands on inbound cells.Nick Mathewson2023-02-091-2/+3
| | | | | | | | | | Unlike C tor, we treat unrecognized commands as reason to kill off the connection entirely. That's fine; if we need to add an unrecognized command in the future, we can use VERSIONS to negotiate it. Also, if someday we want this code to support relay channels as well, we can use some type trickery to have that work too.
* tor-cell: Rename RelayMsg and RelayCell-related types.Nick Mathewson2023-02-071-23/+26
| | | | Thanks to rust-analyzer for making this simple.
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-071-18/+18
|
* tor-cell: Change all variants of RelayMsg to have a body.Nick Mathewson2023-02-071-4/+5
| | | | | Previously, there were some unit variants, but that makes things quite awkward for #525.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* tor-proto: comment fixes and more TODO hsNick Mathewson2023-01-241-0/+12
|
* tor-proto: Draft API to handle incoming BEGIN requests.Nick Mathewson2023-01-171-0/+26
| | | | Onion services (and later, exits and caches) will need this.
* tor-proto: Expose support for doing onion service handshakesNick Mathewson2023-01-171-0/+28
| | | | | | This is a little tricky, but I think that we're not actually exposing too much here. I expect we'll need to tweak this stuff between now and our final version.