aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/connect.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-hsclient: intro_rend_connect: bind `outcome`Ian Jackson2023-06-151-3/+3
| | | | | | | | This will be used in a moment.
* | tor-hsclient: Actually choose which intro points to useIan Jackson2023-06-151-3/+75
| | | | | | | | | | Right now this just always chooses randomly because nothing stores anything in the HashMap.
* | tor-hsclient: Introduce RelayIdForExperienceIan Jackson2023-06-151-9/+37
| | | | | | | | | | Wrap this up in a newtype so we don't accidentally use it for anything else. Provide two constructors, one for storing and one for lookups.
* | tor-hsclient: Add random sort key to UsableIptIan Jackson2023-06-151-0/+6
| |
* | tor-hsclient: provide intro_index accessor for FailedAttemptErrorIan Jackson2023-06-151-1/+0
| |
* | tor-hsclient: impl HasRetryTime for FailedAttemptErrorIan Jackson2023-06-141-1/+1
|/
* tor-hsclient: Add some more debuggingIan Jackson2023-06-131-2/+39
|
* tor-hsclient: Return the circuitIan Jackson2023-06-131-4/+1
|
* tor-hsclient: Conduct the INTRODUCE1 exchangeIan Jackson2023-06-131-6/+35
|
* tor-hsclient: Remove an already-done TODOIan Jackson2023-06-131-3/+0
| | | | Since !1238 we do pass the handshake_state along.
* tor-hsclient: Rename some errors for greater consistencyIan Jackson2023-06-131-5/+5
|
* tor-hsclient: Improve proto_oneshot docsNick Mathewson2023-06-131-1/+1
|
* tor-hsclient: Pass handshake_state to complete_handcshake (fmt)Ian Jackson2023-06-131-1/+4
|
* tor-hsclient: Pass handshake_state to complete_handcshakeIan Jackson2023-06-131-7/+21
| | | | | Pass Introduced to complete_handshake. The lack of this was a slip. Add handshake_state to Introduced, and use it.
* tor-hsclient: Add a missing docIan Jackson2023-06-131-1/+1
| | | | Requested in !1228 but overlooked
* tor-hsclient: Introduce proto_oneshot, to help with message handling (fmt)Ian Jackson2023-06-131-12/+5
|
* tor-hsclient: Introduce proto_oneshot, to help with message handlingIan Jackson2023-06-131-57/+14
| | | | | This gets rid of a lot of repeated `oneshot::<...<Result, ...>>` and a bit of repeated functional code, etc.
* tor-hsclient: (try to) receive the RENDEZVOUS2 messageIan Jackson2023-06-131-7/+22
|
* tor-hsclient: Fix a botched doc commentIan Jackson2023-06-131-1/+1
|
* proto: Convert MsgHandler API to expect a message, not a cell.Nick Mathewson2023-06-121-23/+14
| | | | Closes #887.
* hsclient: fill in a lot more introduce/rendezvous logic.Nick Mathewson2023-06-121-4/+146
| | | | | | This code tries to fill in some TODO HS code, replacing it with a lot more code with a bunch more TODO HS comments. Hopefully the expansions of the new TODO HS comments should be simpler.
* hsclient: receive rendezvous2 messages too.Nick Mathewson2023-06-121-17/+25
|
* hsclient: Move the body of the msg handler into a new functionNick Mathewson2023-06-121-26/+41
|
* hsclient: Add a second oneshot to Rendezvous msghandlerNick Mathewson2023-06-121-9/+36
| | | | | | On a client's circuit to the rendezvous point, we need to first wait for an `RENDEZVOUS_ESTABLISHED` message, and then for a `RENDEZVOUS2` message.
* proto: Have send_control_message take an AnyRelayMsg.Nick Mathewson2023-06-091-6/+6
| | | | | | | | | | 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.
* tor-hsclient: Use send_control_message properly (fmt)Ian Jackson2023-06-091-10/+10
| | | | This re-indents the body of the trapping IEFE.
* tor-hsclient: Use send_control_message properlyIan Jackson2023-06-091-14/+18
| | | | | | | | | | The comment was entirely wrong. send_control_message returns as soon as the message has been enqueued. So we actually *need* to wait for the oneshot. Also, given that a circuit collapse doesn't give us a real error, we plumb the error through the oneshot. Introduce an IEFE to capture the error from the decoding.
* tor-hsclient: Obtain reply_tx earlierIan Jackson2023-06-091-3/+5
| | | | | | No functional change other than to error cases. Will fit better with code to come in a moment.
* tor-hsclient: Break out handle_proto_errorIan Jackson2023-06-091-4/+6
| | | | We're going to want to reuse this.
* tor-hsclient: Add TODO for broken send_control_message useIan Jackson2023-06-091-0/+1
|
* tor-hsclient: Discuss circuit parallelisation in sad caseIan Jackson2023-06-091-1/+6
| | | | | Apropose https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910588
* tor-hsclient: Add a TODO to retain the NetDir less longIan Jackson2023-06-091-0/+5
|
* tor-hsclient: Add some trace! temporarilyIan Jackson2023-06-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | With this I see this: 2023-06-09T12:26:27.698815Z DEBUG tor_hsclient::connect: hs conn to duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion: RPT $36acd600bc8ea6c2800434778909ce3d83621358: sending ESTABLISH_RENDEZVOUS 2023-06-09T12:26:27.699144Z TRACE tor_proto::circuit::reactor: Circ 1.0: reactor received SendMsgAndInstallHandler { msg: RelayCell { streamid: StreamId(0), msg: EstablishRendezvous(EstablishRendezvous { cookie: RendCookie(CtByteArray([220, 39, 37, 30, 37, 108, 111, 23, 127, 220, 50, 108, 161, 109, 229, 235, 110, 88, 233, 38])) }) }, sender: Sender { complete: false } } 2023-06-09T12:26:27.699238Z TRACE tor_guardmgr: Received report of guard status guard_id=FirstHopId(Guard(Default, GuardId(RelayIds { ed_identity: Some(Ed25519Identity { 6lORxW93KRbhHFPNG0g+oBkXZbRnpwBzyfDcta7ed/M }), rsa_identity: Some(RsaIdentity { $f0c9c07d1b7c6fc8547f52cac1015b4a79e2ac1a }) }))) status=Success 2023-06-09T12:26:27.699429Z TRACE tor_hsclient::connect: SEND CONTROL MESSAGE RETURNED 2023-06-09T12:26:27.699966Z INFO tor_guardmgr::guard: We have found that guard [scrubbed] is usable. 2023-06-09T12:26:27.700030Z TRACE tor_guardmgr::guard: Guard status changed. guard_id=GuardId(RelayIds { ed_identity: Some(Ed25519Identity { 6lORxW93KRbhHFPNG0g+oBkXZbRnpwBzyfDcta7ed/M }), rsa_identity: Some(RsaIdentity { $f0c9c07d1b7c6fc8547f52cac1015b4a79e2ac1a }) }) old=Untried new=Reachable 2023-06-09T12:26:27.700607Z TRACE tor_guardmgr: Known usability status guard_id=FirstHopId(Guard(Default, GuardId(RelayIds { ed_identity: Some(Ed25519Identity { 6lORxW93KRbhHFPNG0g+oBkXZbRnpwBzyfDcta7ed/M }), rsa_identity: Some(RsaIdentity { $f0c9c07d1b7c6fc8547f52cac1015b4a79e2ac1a }) }))) usable=true 2023-06-09T12:26:27.701481Z DEBUG arti_client::status: 45%: connecting successfully; directory is fetching authority certificates (8/8) 2023-06-09T12:26:27.765193Z TRACE tor_proto::circuit::reactor: Circ 1.0: handling cell: Relay(Relay { body: .. }) 2023-06-09T12:26:27.765284Z TRACE tor_proto::circuit::reactor: Circ 1.0: Received meta-cell UnparsedRelayCell { body: [39, 0, 0, 0 [[[ eldied -iwj ]]]] } 2023-06-09T12:26:27.765352Z TRACE tor_hsclient::connect: SENDING VIA ONESHOT 2023-06-09T12:26:27.765363Z TRACE tor_hsclient::connect: SENDING VIA ONESHOT DONE 2023-06-09T12:26:27.765367Z TRACE tor_proto::circuit::reactor: Circ 1.0: meta handler completed with result: Ok(UninstallHandler) 2023-06-09T12:26:29.588045Z DEBUG tor_hsclient::connect: hs conn to duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion: attempt failed: error: internal error (bug) at /volatile/rustcargo/Rustup/Arti/arti/crates/tor-hsclient/src/connect.rs:725:28: RENDEZVOUS_ESTABLISHED not sent yet This seems to suggest that send_control_message is returning sooner than expected.
* tor-hsclient: Add a lot of debug! (fmt)Ian Jackson2023-06-091-1/+4
|
* tor-hsclient: Add a lot of debug!Ian Jackson2023-06-091-3/+46
|
* tor-hsclient: Discuss gold-plated handling of RENDEZVOUS_ESTABLISHEDIan Jackson2023-06-091-0/+6
|
* tor-hsclient: Check RENDEZVOUS_ESTABLISHED *after* it should existIan Jackson2023-06-091-5/+5
| | | | | | | Bugfix, without which this code wouldn't work. Reported in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910293
* tor-hsclient: Discuss performance and circuit build serialisationIan Jackson2023-06-091-0/+12
|
* tor-hsclient: Add TODO about trying multiple IPTs in parallelIan Jackson2023-06-091-0/+2
|
* tor-hsclient: Expand TODO about IPT selection to mention randomnessIan Jackson2023-06-091-1/+2
|
* tor-hsclient: tuning parameters: TODO about getting from the netdirIan Jackson2023-06-091-2/+2
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910286 Not thinking about this right now, but it seems like a reasonable suggestion.
* tor-hsclient: Add vacuous doc commentsIan Jackson2023-06-091-6/+6
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910284
* tor-hsclient: Improve description of `Context`Ian Jackson2023-06-091-3/+7
| | | | | Be more specific about precisely what it's the context for, and its lifetime.
* tor-hsclient: mocks: Fix new code to use mockable ClientCircIan Jackson2023-06-091-18/+36
|
* tor-hsclient: mocks: Make MockableClientCirc be DebugIan Jackson2023-06-091-1/+2
|
* tor-hsclient: mocks: Provide send_control_messageIan Jackson2023-06-091-0/+21
| | | | | | | We were able to get as far as we have, merely because all the new code uses just Arc<ClientCirc> rather than the mockable version. We want to change that, so we need to mock this function too.
* tor-hsclient: Call the mock with the result circuitIan Jackson2023-06-091-0/+5
|
* tor-hsclient: Define representation of intro point experience dataIan Jackson2023-06-091-3/+44
| | | | | This is the data structure for recording IPT outcomes and, later, selecting a good IPT to try for a new connection.
* tor-hsclient: Implement rendezvous setup, and retry frameworkIan Jackson2023-06-091-6/+339
| | | | | | | | | | | | | | | | | | | | | This contains code to: * Iterate over introduction points * Make multiple attempts to connect * Apply timeouts to the various phases of each attempt * Establish a rendezvous point * Represent errors that occur during the above It provides places to add: * Implementation of the INTRODUCE1/INTRODUCE_ACK handshake * Reception of RENDEZVOUS2 and actual end-to-end circuit establishment * Recording of the outcome of connection attempts via particular IPTs * Using previous IPT outcome information for selecting IPTs to try * Tests of the new code (although more mocking will probably be needed) Much of this code works with a fixed type ClientCirc rather than going via the Mockable traits. That is wrong, and it will be fixed later.
* tor-hsclient: Mocks: Add get_or_launch_client_rend to mock poolIan Jackson2023-06-091-0/+19
| | | | This has the wrong return type at the moment.