summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
| * Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
| |
* | tor-proto: Add ClientCirc::start_conversation().Gabriela Moldovan2023-08-045-19/+33
| | | | | | | | | | | | | | | | | | | | | | This will enable hidden services to send `RENDEZVOUS1` messages to the `N`th hop of the circuit rather than the `N + 1`th virtual one (which can only used after the client and service have completed the introduction handshake). This also deprecates `start_conversation_last_hop`. Closes #959
* | tor-proto: Add method for getting the HopNum of the last hop.Gabriela Moldovan2023-08-042-0/+15
| |
* | tor-proto: Make HopNum public.Gabriela Moldovan2023-08-043-1/+3
|/ | | | | | `HopNum` will be used in `ClientCirc`'s public API when we refactor `ClientCirc::start_conversation_last_hop` to use the provided hop rather than always using the last one.
* tor-proto: Bump test sleep to 200ms for now.Gabriela Moldovan2023-08-031-5/+10
| | | | | | | | | | | | This `sleep` is to give the reactor task a chance to process the `AwaitIncomingStream` message. With an 100ms, this test sometimes fails because for some reason the reactor doesn't get a chance to process the `AwaitIncomingStream` control command before the BEGIN cell from the client task is received. This bumps the sleep time to 200ms for now (TODO: follow-up with an MR with a less flaky approach). While trying to repro the issue, I found another corner case for which I've added a TODO HSS.
* tor-proto: Handle new BEGIN cells for rejected stream.Gabriela Moldovan2023-08-032-0/+101
| | | | | | | | | This updates the reactor to call the incoming stream handler even for streams for which we have a stream map entry of `EndSent`. If we've sent an END message for a stream but have not yet received an END message back from the other party, but we later receive a BEGIN from them, it is safe to assume we cam remove the stream from the stream map and handle the new incoming stream request.
* tor-proto: Clarify what we mean by "stream" in allow_stream_requests.Gabriela Moldovan2023-08-031-3/+3
|
* tor-proto: Add note about making hop_num optional.Gabriela Moldovan2023-08-031-0/+7
|
* tor-proto: Add a TODO about checking if a hop is allowed to create streams.Gabriela Moldovan2023-08-031-0/+3
|
* tor-proto: Remove unnecessary else-branch.Gabriela Moldovan2023-08-031-38/+38
| | | | | We return early if `message_closes_stream == true`, so we can get rid of the `else` to remove one level of indentation.
* tor-proto: Update the stream map if we get an END message.Gabriela Moldovan2023-08-031-1/+5
| | | | | This handles the previously not handled `message_closes_stream == true` case.
* tor-proto: Add TODO regarding allow_stream_requests corner case.Gabriela Moldovan2023-08-031-0/+24
|
* tor-proto: Remove outdated comments.Gabriela Moldovan2023-08-031-3/+0
|
* tor-proto: Add a test for allow_stream_requests.Gabriela Moldovan2023-08-031-0/+70
|
* tor-proto: Implement allow_stream_requests.Gabriela Moldovan2023-08-032-7/+51
|
* tor-proto: Handle RELAY_BEGIN cells if we have an incoming req handler.Gabriela Moldovan2023-08-031-0/+84
|
* tor-proto: Implement IncomingStream::{accept_data, request, reject}.Gabriela Moldovan2023-08-032-6/+38
|
* tor-proto: Add StreamTarget function for sending CtrlMsg::CloseStream .Gabriela Moldovan2023-08-031-0/+46
| | | | This will be used by `IncomingStream` to implement `reject()`.
* tor-proto: Add reactor control commands for accepting/closing incoming streams.Gabriela Moldovan2023-08-031-4/+62
| | | | | | | | | This adds a new `AwaitIncomingStream` control message for registering an interest in an incoming stream. This also adds a `ClosePendingStream` control message for explicitly closing a stream with a given END message (needed for implementing `IncomingStream::reject`).
* tor-proto: Add types for sharing stream request info with the reactor.Gabriela Moldovan2023-08-031-0/+49
|
* tor-proto: Add a helper for adding a stream entry with a specific stream ID.Gabriela Moldovan2023-08-032-2/+47
| | | | | | | | | This adds a new `add_ent_with_id` function for adding a new entry to the `StreamMap`. The existing `add_ent` function auto-generates a new stream ID, which is not good if we're a hidden service, as stream IDs are supposed to be chosen by the OP (client). When accepting a new stream, services, exit relays, and dir auths need to use the stream ID received in the BEGIN cell (instead of generating a new stream ID).
* tor-proto: Remove extraneous space.Gabriela Moldovan2023-08-032-2/+2
|
* tor-proto: Add constructors for pre-connected DataStreams.Gabriela Moldovan2023-08-031-2/+41
| | | | | | | | | When accepting a new stream, hidden services, exit relays and dirauths don't wait for a `CONNECTED` cell from the initiator. This commit adds constructors for building `DataStream`s and `DataCmdChecker`s that can immediately receive data cells (and don't expect to receive `CONNECTED` cells at all).
* tor-proto: Add a constructor for IncomingStream.Gabriela Moldovan2023-08-031-0/+13
|
* tor-proto: Add imports for commonly used types.Gabriela Moldovan2023-08-031-4/+4
|
* tor-proto: Add IncomingCmdChecker for IncomingStream.Gabriela Moldovan2023-08-032-2/+62
|
* Remove semver.md files now that 1.1.7 is out.Nick Mathewson2023-08-011-1/+0
|
* Increment patchlevel versions of crates with minor changesNick Mathewson2023-08-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are at version 0.x.y, so we don't need to distinguish new-feature changes from other changes: ``` tor-basic-utils fs-mistrust tor-error tor-geoip tor-checkable tor-linkspec tor-netdoc tor-netdir tor-persist tor-ptmgr tor-hsservice ``` This crate has a breaking change, but only when the semver-breaking feature `experimental-api` is enabled: ``` tor-config ``` This crate is at version 1.x.y, but has no new public APIs, and therefore does not need a minor version bump: ``` arti ```
* Update minor versions on crates that have had breaking changesNick Mathewson2023-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates had first-order breaking changes: ``` retry-error tor-keymgr tor-proto tor-hsclient tor-rtmock ``` Additionally, these broke because they re-exposed RetryError: ``` tor-circmgr ``` Additionally, these broke because they may re-expose something from tor-proto: ``` arti-client tor-chanmgr tor-dirclient tor-dirmgr tor-guardmgr ``` Additionally, these broke for other fiddly reasons: `tor-ptmgr` implements traits from tor-chanmgr, which has a breaking change above. `arti-hyper` exposes types from arti-client in its API.
* tor-proto: Rename create_firsthop() to wait_for_create().Gabriela Moldovan2023-07-271-2/+2
|
* tor-proto: Update handle_control docs.Gabriela Moldovan2023-07-261-1/+1
|
* tor-proto: Add functions for handling Shutdown and AddFakeHop messages.Gabriela Moldovan2023-07-261-42/+37
| | | | | This helps reduce code duplication, as `CtrlMsg::Shutdown` and `CtrlMsg::AddFakeHop` are now handled in multiple places.
* tor-proto: Extract first-hop creation to a separate function.Gabriela Moldovan2023-07-261-37/+11
| | | | | | I think it's safe to handle `ChanMsg::Create` separately, because there's nothing for the reactor to do until the first hop of the circuit is created (so blocking on this _should_ be alright).
* 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-122-0/+2
| | | | | 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-122-2/+0
| | | | These fns are in a feature-gated impls on feature-gated structs.
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-1117-0/+17
|\ | | | | | | | | 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-1017-0/+17
| |
* | Merge branch 'conversation' into 'main'Alexander Færøy2023-07-105-114/+205
|\ \ | |/ |/| | | | | Overhaul send_control_message See merge request tpo/core/arti!1367
| * tor-proto: run rustfmtIan Jackson2023-06-303-8/+18
| |
| * tor-proto conversations: semverIan Jackson2023-06-301-0/+1
| |
| * tor-proto conversations: Update a TODOIan Jackson2023-06-301-1/+1
| | | | | | | | The feature name is wrong now.
| * 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-303-6/+58
| |
| * 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 conversation API: Implement ConversationIan Jackson2023-06-301-89/+98
| | | | | | | | | | Now, after you call start_conversation_last_hop, you can send more messages if you like.
| * tor-proto: Make the handler in SendMsgAndInstallHandler optionalIan Jackson2023-06-302-3/+10
| | | | | | | | | | We're going to want to do almost-the-same thing but without installing a new handler.
| * tor-proto conversation API: Return a ConversationIan Jackson2023-06-302-9/+16
| | | | | | | | | | This is just a placeholder for now, but it'll be a thing you can send more messages with.
| * tor-proto conversation API: Rename to start_conversation_last_hopIan Jackson2023-06-303-10/+10
| | | | | | | | Was send_control_message.