summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/circuit
Commit message (Collapse)AuthorAgeFilesLines
* proto: Remove support for receiving unauthenticated SENDMEsNick Mathewson2023-06-261-108/+9
| | | | | | | 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-222-36/+104
|\ | | | | | | | | | | | | 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/+6
| |
| * proto: Implement Redactable and Display for PathEntry.Nick Mathewson2023-06-221-0/+23
| |
| * proto: Make Path and PathEntry at least minimally usefulNick Mathewson2023-06-221-0/+28
| | | | | | | | | | (I'm not 100% sure about having both hops() and iter(). Should I remove one?)
| * proto: Expose an opaque PathEntry.Nick Mathewson2023-06-222-15/+22
| | | | | | | | | | | | 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-4/+7
| | | | | | | | (You can't get one yet or do much with it.)
| * proto: Remove Mutex from Path.Nick Mathewson2023-06-222-17/+9
| | | | | | | | | | 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/+18
| | | | | | | | (We're about to remove the interior mutability from Path.)
* | proto: Downgrade a comment about unauthenticated SENDMEsNick Mathewson2023-06-211-5/+9
| | | | | | | | We never actually need to allow these again; see #914
* | proto::circuit::handshake: downgrade a "TODO HS".Nick Mathewson2023-06-211-2/+2
|/
* proto: Convert MsgHandler API to expect a message, not a cell.Nick Mathewson2023-06-122-7/+16
| | | | Closes #887.
* tor-circmgr: send_control_message: Change a rename proposalIan Jackson2023-06-051-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1218#note_2908119
* tor-circmgr: send_control_message: Fix reference to circuitIan Jackson2023-06-051-1/+1
|
* tor-circmgr: Propose to rename `MetaCellDisposition::UninstallHandler`Ian Jackson2023-06-051-0/+4
|
* tor-circmgr: send_control_message: Clarify some corner casesIan Jackson2023-06-051-0/+2
| | | | | | | | | | | | 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/+1
| | | | | This fixes a warning when building tor-proto without the `rpc-common` feature.
* Merge branch 'virtual_hop' into 'main'Nick Mathewson2023-05-183-9/+108
|\ | | | | | | | | | | | | tor-proto: Add support for extending circuits through virtual hops. Closes #726 See merge request tpo/core/arti!1191
| * proto: Allow circuit Paths to represent virtual hops.Nick Mathewson2023-05-182-11/+36
| | | | | | | | | | 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-0/+42
| | | | | | | | | | | | | | 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-1/+33
| | | | | | | | | | This is fairly straightforward, thanks to our existing design work on this code.
* | tor-guardmgr, tor-proto: minor logging tweakseta2023-05-181-2/+2
|/ | | | | | | | - We make the tor-guardmgr "We have found that {} is usable" line include the word "guard", otherwise it doesn't appear very useful to a user in safe logging mode, since the guard gets replaced with [scrubbed]. - The "Actually got an end cell..." message is downgraded to DEBUG.
* Change CircTarget::linkspecs() to return an encoded list.Nick Mathewson2023-05-101-3/+3
| | | | | | | | 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: Feature-conditionalise some enum variantsIan Jackson2023-03-231-0/+6
| | | | This avoids some dead code warnings when building without send-control-msg.
* tor-proto: Split off send-control-msg featureIan Jackson2023-03-231-1/+1
|
* tor-proto: Say "control message" a little more consistentlyNick Mathewson2023-03-081-1/+2
| | | | | | | (I found "user request" in one place, and fixed that. I am not currently going to try to unify "control message" and "meta message" since both terms are misleading and we already have TODOs to try to merge them into a third better term.)
* tor-proto: Make send_control_message wait for the reactor.Nick Mathewson2023-03-081-3/+15
| | | | | 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-082-91/+65
|
* tor-proto: Implement functionality to send a message and accept repliesNick Mathewson2023-03-082-5/+115
| | | | | | | | | | | 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: Change semantics of MetaCellHandlerNick Mathewson2023-03-081-72/+126
| | | | | | | | | | | | | | | | | Now, the MetaCellHandler is responsible for consuming the messages it gets, and reporting status to whatever task is waiting for a status message. Additionally, the MetaCellHandler can decide to remain installed or shut down the circuit after a successful message. (Previously, it could only uninstall itself on success and kill the circuit on failure.) These changes will enable MetaCellHandlers to be used as the basis for handling more kinds of message. (There is some moved and reformatted code here; you may want to review it with `git {diff or show} --color-moved -b`.)
* tor-proto: Give Path a method to access final hop num.Nick Mathewson2023-03-081-0/+10
|
* tor-proto: Give circ Reactor a constructor, and make its fields private.Nick Mathewson2023-03-081-12/+46
|
* proto: Tweak documentation and names around CmdChecker.Nick Mathewson2023-02-272-1/+17
|
* tor-proto: Rename end_received.Nick Mathewson2023-02-172-8/+9
| | | | It can now indicate _any_ cell that means we can forget about a stream.
* Use CmdChecker in our stream handling code.Nick Mathewson2023-02-173-93/+80
| | | | | | | | | | 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: Add a TODO about simplifying a common pattern.Nick Mathewson2023-02-151-0/+8
|
* tor-proto: Push stream message parsing into the stream objects.Nick Mathewson2023-02-153-20/+21
| | | | | This closes #525, and ensures, at last, that we don't parse any message that we wouldn't accept.
* tor-proto: Defer parsing of messages send to half-closed streamsNick Mathewson2023-02-153-42/+94
| | | | | | This includes a partial solution for #769, but also turned up another bug (#774) while I was working on it. I'll close them both once I have a real solution.
* tor-proto: stop reactor (and kill circuit) if meta handler failsNick Mathewson2023-02-151-4/+7
| | | | | | | If the meta handler reports an error, then the circuit has violated its protocol, and needs to be shut down. Fixes #773.
* tor-proto: defer meta-cell parsing to the last moment.Nick Mathewson2023-02-151-33/+23
|
* tor-proto: Use UnparsedRelayCell to start deferring cell processing.Nick Mathewson2023-02-152-22/+43
| | | | | In general, we want to avoid parsing these cells until we are fairly sure that they are something we would accept.
* tor-cell: Refactor relay cells to copy much lessNick Mathewson2023-02-151-2/+2
| | | | | | | | | | | | | 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.
* tor-cell: Make RelayEarly a separate type.Nick Mathewson2023-02-092-4/+4
| | | | This allows us to remove a shenanigan from `restricted_msg!{}`.
* tor-cell: Have restrict_msg add conversion functions.Nick Mathewson2023-02-091-2/+2
| | | | | | | | | | | | | | | | Every FooMsg type now implements Into<AnyFooMsg>, and TryFrom<FooMsg>. Additionally, it now implements From<X> for every distinct type that it supports. This last part lets us discard a bunch of code. Unfortunately, I needed some downright hackish trickery in order to get these macros to avoid generating `From<AnyFooMsg> for AnyFooMsg` and conflicting with the blanket implementation. The trickery to deal with RelayEarly and Relay being the same type was not necessarily worth it; I will be separating them and removing said trickery in the next commit.
* tor-cell: Rename RelayMsg and RelayCell-related types.Nick Mathewson2023-02-074-48/+54
| | | | Thanks to rust-analyzer for making this simple.
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-072-27/+27
|
* tor-cell: Remove RelayMsg methods that are duplicated in RelayMsgClass.Nick Mathewson2023-02-072-2/+2
|
* tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.Nick Mathewson2023-02-072-2/+5
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-274-0/+4
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Merge branch 'sensitive' into 'main'eta2023-01-261-3/+4
|\ | | | | | | | | tor-proto: Mark stream ids in errors as sensitive See merge request tpo/core/arti!986