aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/circuit
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-proto: Create a function for handling the initial CREATE cell.Gabriela Moldovan2023-07-261-1/+89
| | | | | | This logic from `create_firsthop()` was extracted (copied) from `Reactor::run_once()`. A future commit will update `Reactor::run_once()` to use `create_firsthop()`.
* tor-circmgr: Add two possibly-needed docsrs annotationsIan Jackson2023-07-121-0/+1
| | | | | I don't know if these are needed because the rules are not documented afaict. But it seems like probably they ought to be there?
* tor-proto: Conversation: drop two otiose cfg(feature)Ian Jackson2023-07-121-1/+0
| | | | These fns are in a feature-gated impls on feature-gated structs.
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-114-0/+4
|\ | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-104-0/+4
| |
* | Merge branch 'conversation' into 'main'Alexander Færøy2023-07-102-24/+90
|\ \ | |/ |/| | | | | Overhaul send_control_message See merge request tpo/core/arti!1367
| * tor-proto: run rustfmtIan Jackson2023-06-302-7/+14
| |
| * tor-proto conversations: Drop a TODOIan Jackson2023-06-301-1/+0
| | | | | | | | I think this name is fine.
| * tor-proto conversation API: Provide ConversationInHandlerIan Jackson2023-06-302-5/+52
| |
| * tor-proto circuit: Plumb async Context throughIan Jackson2023-06-302-3/+8
| | | | | | | | handle_msg is going to want this in a moment.
| * tor-proto conversation API: Soften a warningIan Jackson2023-06-301-1/+4
| | | | | | | | | | If the circuit is just being used by us (which is likely, if we're using this API) then the only reactor we're blocking is our own.
| * tor-proto: Make the handler in SendMsgAndInstallHandler optionalIan Jackson2023-06-301-2/+9
| | | | | | | | | | We're going to want to do almost-the-same thing but without installing a new handler.
| * tor-proto conversation API: Rename to start_conversation_last_hopIan Jackson2023-06-301-2/+2
| | | | | | | | Was send_control_message.
| * tor-proto conversation API: Make starting message optionalIan Jackson2023-06-301-3/+5
| | | | | | | | | | We're going to let people start a conversation and either expect to receive first, or send messages ad-hoc later.
| * tor-proto conversation API: Rename to ConversationFinishedIan Jackson2023-06-301-7/+3
| | | | | | | | | | | | Was UninstallHandler. We are going to talk more about conversations and less about handlers (although, the fact of there being a handler will still be visible).
| * tor-proto circuit: Make reactor::run_once modulae-privateIan Jackson2023-06-301-1/+1
| | | | | | | | Nothing else wants this and having it pub(super) is confusing.
* | Avoid matches!(x, None), matches!(x, Ok(_))Nick Mathewson2023-07-061-2/+2
|/ | | | This appeases clippy-nightly.
* 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
|