Nick Mathewson
c38ba16a81
proto: code movement and reindentation in hs_ntor
2023-06-12 13:15:59 -04:00
Nick Mathewson
7255b122d7
proto: Remove now-unused hs_ntor APIs
2023-06-12 13:15:59 -04:00
Nick Mathewson
bb6115103a
proto: refactor hs_ntor to reuse state.
...
We want the ability to send the same handshake request in parallel
on multiple introduce circuits. This implies encoding the client
handshake more than once.
(Sadly we can't _actually_ do this in the protocol as it stands,
since the onion service can use a separate KP_hss_ntor for each
introduction point; I'll add a comment to that effect later.)
2023-06-12 13:15:59 -04:00
Nick Mathewson
edfb3642e0
hsclient: receive rendezvous2 messages too.
2023-06-12 13:15:59 -04:00
Nick Mathewson
32d54c857e
hsclient: Move the body of the msg handler into a new function
2023-06-12 13:15:59 -04:00
Nick Mathewson
e948116bc7
hsclient: Add a second oneshot to Rendezvous msghandler
...
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.
2023-06-12 13:15:59 -04:00
Nick Mathewson
796dc4457b
hsclient: use hs-client feature in tor-proto.
2023-06-12 13:15:59 -04:00
Nick Mathewson
ac90cb7500
Upgrade async-trait requirement to 1.54
...
We need the fix from [82d69902], which first appeared in async-trait
version 1.54. (Technically we only need this fix in tor-hsclient,
but we may as well update our minimal async-trait version everywhere.)
[82d69902]: 82d6990253
2023-06-12 13:15:59 -04:00
Nick Mathewson
3b93cdb2dd
Merge branch 'redactable_relayids' into 'main'
...
Implement Redactable for RelayIds, and other improvements
Closes #882
See merge request tpo/core/arti!1233
2023-06-12 16:06:11 +00:00
Nick Mathewson
ddea524849
linkspec: cleanup usage; change std::fmt to fmt.
2023-06-12 11:39:45 -04:00
Nick Mathewson
345808322d
Merge branch 'circuit_send_message_fixes' into 'main'
...
Correct documentation and API on ClientCirc::send_control_message
Closes #885 and #881
See merge request tpo/core/arti!1232
2023-06-12 14:14:32 +00:00
Ian Jackson
da78c53e20
Merge branch 'arc_hsdirs_in_netdir' into 'main'
...
netdir: Wrap HsDir an Arc<>
Closes #883
See merge request tpo/core/arti!1234
2023-06-12 13:56:44 +00:00
Ian Jackson
4ee4de2d0a
Apply 1 suggestion(s) to 1 file(s)
2023-06-12 13:49:18 +00:00
Nick Mathewson
b19eb8648f
Merge branch 'pt-snowflake' into 'main'
...
add documentation for configuring snowflake pt
Closes #879 and #875
See merge request tpo/core/arti!1216
2023-06-11 20:59:31 +00:00
Nick Mathewson
0313ca9f62
netdir: Wrap HsDir an Arc<>
...
This change reduces the cost of cloning a `NetDir`. It's fine
since–although we replace the HsDir once–we never modify it once it
exists.
Closes #883 .
2023-06-09 16:08:57 -04:00
Nick Mathewson
a542a3e93f
RelayId: Display the ID type on redacted identities.
...
Formerly we would display just the first characters of the identity,
without telling you what kind of ID it was.
2023-06-09 16:03:56 -04:00
Nick Mathewson
a6ce079d4a
linkspec: implement Display/Redacted on RelayIds
2023-06-09 16:03:56 -04:00
Nick Mathewson
979a2bd6a0
linkspec: Implement HasRelayIds::display_relay_ids().
2023-06-09 15:50:25 -04:00
Nick Mathewson
c76fbff125
proto: Have send_control_message take an AnyRelayMsg.
...
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 .
2023-06-09 15:28:01 -04:00
Nick Mathewson
58babcb756
proto: Correct the docs on send_control_message
...
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 .
2023-06-09 15:22:15 -04:00
trinity-1686a
a74bb8d4d8
add a few more comments on PTs
2023-06-09 20:15:25 +02:00
Nick Mathewson
d38463cc1b
Merge branch 'hs2' into 'main'
...
tor-hsclient: Fix use of send_control_message
See merge request tpo/core/arti!1230
2023-06-09 18:06:10 +00:00
Ian Jackson
81232ded9a
Merge branch 'hs' into 'main'
...
Implement rendezvous setup, and hsconn attempt/retry framework
See merge request tpo/core/arti!1228
2023-06-09 17:19:00 +00:00
Ian Jackson
7231042343
tor-hsclient: Use send_control_message properly (fmt)
...
This re-indents the body of the trapping IEFE.
2023-06-09 17:47:35 +01:00
Ian Jackson
e4a3498f28
tor-hsclient: Use send_control_message properly
...
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.
2023-06-09 17:45:50 +01:00
Ian Jackson
8d71ceef9a
tor-hsclient: Obtain reply_tx earlier
...
No functional change other than to error cases.
Will fit better with code to come in a moment.
2023-06-09 17:45:41 +01:00
Ian Jackson
27b76ffa3c
tor-hsclient: Break out handle_proto_error
...
We're going to want to reuse this.
2023-06-09 17:45:29 +01:00
Ian Jackson
c9cc76addb
tor-hsclient: Add TODO for broken send_control_message use
2023-06-09 17:36:48 +01:00
Ian Jackson
9240ae55ba
tor-hsclient: Discuss circuit parallelisation in sad case
...
Apropose
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910588
2023-06-09 17:36:48 +01:00
Ian Jackson
5cc1323752
tor-hsclient: Add a TODO to retain the NetDir less long
2023-06-09 17:36:48 +01:00
Ian Jackson
a9a59186fa
tor-hsclient: Add some trace! temporarily
...
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:💂 We have found that guard [scrubbed] is usable.
2023-06-09T12:26:27.700030Z TRACE tor_guardmgr:💂 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.
2023-06-09 17:36:48 +01:00
Ian Jackson
7be005b05d
tor-hsclient: Add a lot of debug! (fmt)
2023-06-09 17:36:48 +01:00
Ian Jackson
2a34f69c88
tor-hsclient: Add a lot of debug!
2023-06-09 17:36:48 +01:00
Ian Jackson
57f295cc21
safelog: Provide Redacted.as_inner() and .as_ref()
...
Just like for Sensitive.
2023-06-09 17:36:48 +01:00
Ian Jackson
c679e8706a
tor-hsclient: Add missing `#[source]` annotation for `Failure` error
...
Without this, the printed errors are very bland.
2023-06-09 17:36:48 +01:00
Ian Jackson
16d58d641e
tor-hsclient: Discuss gold-plated handling of RENDEZVOUS_ESTABLISHED
2023-06-09 17:36:48 +01:00
Ian Jackson
1fb4c1eb2a
tor-hsclient: Check RENDEZVOUS_ESTABLISHED *after* it should exist
...
Bugfix, without which this code wouldn't work.
Reported in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910293
2023-06-09 17:36:48 +01:00
Ian Jackson
180f1dcb47
tor-hsclient: Discuss performance and circuit build serialisation
2023-06-09 17:36:48 +01:00
Ian Jackson
4b94b63081
tor-hsclient: Add TODO about trying multiple IPTs in parallel
2023-06-09 17:36:48 +01:00
Ian Jackson
a4755e2e46
tor-hsclient: Expand TODO about IPT selection to mention randomness
2023-06-09 17:36:48 +01:00
Ian Jackson
2f838dce15
tor-hsclient: tuning parameters: TODO about getting from the netdir
...
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.
2023-06-09 17:36:48 +01:00
Ian Jackson
00d5978999
tor-hsclient: Add vacuous doc comments
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910284
2023-06-09 17:36:48 +01:00
Ian Jackson
b2faf02170
tor-hsclient: Add a TODO for changing RendPtIdentityForError
2023-06-09 17:36:48 +01:00
Ian Jackson
bcbe66f636
tor-hsclient: Improve description of `Context`
...
Be more specific about precisely what it's the context for, and its
lifetime.
2023-06-09 17:36:48 +01:00
Ian Jackson
4e2321086f
tor-hsclient: Correct InvalidTarget error
...
Remove TODO comment; instead, replace with a comment about future use
for HS server side, inspired by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228/diffs?commit_id=ecfd39507c4e8d52788f4599d6275cab3b4a2a5f#c0123bb2f6b9a9ca50fa45886b667580a7dc951e_79_82
Do not implment `tor_error::HasKind`; the true kind depends on where
the bad information came from, which the calling code will understand.
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228/diffs?commit_id=d63ad3ab041460bf85defb99b31d6ebe075a0eb1#c0123bb2f6b9a9ca50fa45886b667580a7dc951e_101_110
2023-06-09 17:36:48 +01:00
Ian Jackson
742462deae
tor-hsclient: mocks: Fix new code to use mockable ClientCirc
2023-06-09 17:36:48 +01:00
Ian Jackson
6c377cdeec
tor-hsclient: mocks: Make MockableClientCirc be Debug
2023-06-09 17:36:48 +01:00
Ian Jackson
cead8e2716
tor-hsclient: mocks: Provide send_control_message
...
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.
2023-06-09 17:36:48 +01:00
Ian Jackson
8e5814c683
tor-hsclient: Call the mock with the result circuit
2023-06-09 17:36:48 +01:00
Ian Jackson
90a48f5b52
tor-hsclient: Define representation of intro point experience data
...
This is the data structure for recording IPT outcomes and, later,
selecting a good IPT to try for a new connection.
2023-06-09 17:36:48 +01:00