Commit Graph

6102 Commits

Author SHA1 Message Date
Ian Jackson 70b099fd0f Turn two blocking TODOs in hsdesc into "TODO HS"
TODO HS is blocking for HS release, but not for CI.
2023-03-21 13:08:14 +00:00
Ian Jackson d24a47c1d9 Sort out some TODOs in bdtest.rs 2023-03-21 13:08:14 +00:00
Ian Jackson 52470e4ffe Convert blockers in arti-testing to TODOs
I don't think these are that bad in testing code.
2023-03-21 13:08:14 +00:00
Ian Jackson 541c5338af maint/check_todos: New script 2023-03-21 13:08:14 +00:00
Nick Mathewson c48b6813b4 Merge branch 'fixup-features-tool' into 'main'
New "fixup-features" tool to enforce properties in Cargo.tomls

Closes #771

See merge request tpo/core/arti!1059
2023-03-20 18:03:38 +00:00
Nick Mathewson 61096d61c3 fixup-features: Use write-and-rename pattern. 2023-03-20 13:29:33 -04:00
Nick Mathewson cd4895e525 fixup-features: Improve a comment. 2023-03-20 13:29:33 -04:00
Nick Mathewson 630d87f9c1 fixup-features: Simplify "optionality" detection. 2023-03-20 13:29:33 -04:00
Nick Mathewson 96cd970398 New "fixup-features" tool to enforce properties in Cargo.tomls
See top-level main.rs comment for an explanation.

Closes #771
2023-03-20 13:29:33 -04:00
Nick Mathewson 1b2f424bbc Merge branch 'unused-type-param' into 'main'
remove unused type parameter

See merge request tpo/core/arti!1066
2023-03-20 11:25:28 +00:00
trinity-1686a a2f2b31751 remove unused type parameter 2023-03-18 20:43:17 +01:00
Alexander Færøy d8f77018f7 Merge branch 'fix-ptmgr-fuzz' into 'main'
tor-ptmgr: Fix fuzzer compilation.

See merge request tpo/core/arti!1063
2023-03-13 19:28:29 +00:00
Alexander Færøy 5b5fd0ee31 Merge branch 'bitflags-upgrade' into 'main'
Upgrade to bitflags 2.0

See merge request tpo/core/arti!1064
2023-03-13 19:27:55 +00:00
Nick Mathewson d6bb8fee0b Upgrade to bitflags 2.0
This version of bitflags now requires us to explicitly list the
traits that we want to derive for our bit-flags structs.
2023-03-13 08:47:14 -04:00
Nick Mathewson 2ddaaafafb tor-ptmgr: Fix fuzzer compilation.
Since we made the internals of the ptmgr protocol parser
conditionally private, we need to tell Cargo to build the fuzzer
with the `experimental-api` feature so that it can access them.
2023-03-13 07:28:55 -04:00
Nick Mathewson 550258f166 Bump to latest fuzzer corpora. 2023-03-13 07:26:21 -04:00
Alexander Færøy c3347d9821 Merge branch 'warnings_168' into 'main'
Resolve a couple of new lints with Rust 1.68

See merge request tpo/core/arti!1062
2023-03-10 12:40:59 +00:00
Nick Mathewson 552acbf07f Fix a bunch of needless-conversion warnings.
Apparently 1.68 now warns when you call into_iter() on something
that's already an iterator.  Fair enough.  Let's stop doing that.
2023-03-10 07:09:50 -05:00
Nick Mathewson bd0f595b83 Suppress a renamed-lint lint.
The derive_hash_xor_eq lint was renamed in 1.68, but we can't use
it under its new name, since we still need to support back to 1.60.

Instead, we suppress the warning about the lint being renamed.
2023-03-10 07:09:50 -05:00
Ian Jackson 82820f59d0 Merge branch 'hsplumb' into 'main'
Plumb `.onion` addresses through to arti-client `client.rs`

See merge request tpo/core/arti!1060
2023-03-09 18:41:18 +00:00
Ian Jackson 8c7224ef36 Discuss in comment why we're not using a newtype for the Strings in Host 2023-03-09 18:09:11 +00:00
Ian Jackson 04d843d846 Classify OnionAddressResolveRequest as NotImplemented
We have a theory about how this ought to work, so it's noit an API
usage error - it's an unimplemented feature.

As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1060#note_2884757
2023-03-09 18:09:08 +00:00
Ian Jackson 5000d11ac3 Reject invalid hostnames
Reject them both for .onion and for "exit" hostnames

This prevents a `Host` from having an invalid hostname in it.
2023-03-09 18:09:08 +00:00
Ian Jackson 8f8df071bc Fix reference to no-longer-contemplated Host variant
Reported in
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1060#note_2884755
2023-03-09 18:09:08 +00:00
Ian Jackson 8ead708512 Dummy HsId::from_str on .onion: Return Bug, rather than panicking
Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1060#note_2884754
2023-03-09 18:09:08 +00:00
Ian Jackson 654f6689cf Improve error from HsId parse of "www.B32.onion"
And add some clarity and todos about address errors.
2023-03-09 18:09:08 +00:00
Ian Jackson 0a618cbe84 Avoid arti_client::ErrorDetail::Address for TorAddrError::InvalidHostname
Provide an explicit From impl isntead.
2023-03-09 18:09:06 +00:00
Ian Jackson 2957719c86 Test HsId parse of subdomain
This error is not great.
2023-03-09 13:41:12 +00:00
Ian Jackson c198a26bf7 arti-client: Parse .onion addresses and dispatch to client.rs
Now, a Host has a separate variant for `.onion` which is always used,
even when HS is disabled.

Currently it ends in a todo!.
2023-03-09 13:41:12 +00:00
Ian Jackson 4502528d0e arti-client: DoThingInstructions: Make error returns consistent
This is more comprehensible, and will be more convenient.
2023-03-09 13:41:12 +00:00
Ian Jackson c31bc1dafe arti-client: Host: Use Display::fmt rather than write!
write! is less good because the `{}` overwrites stuff like "did the
caller ask for padding".
2023-03-09 13:41:12 +00:00
Nick Mathewson 2bf71de199 Merge branch 'tor-proto-extensions' into 'main'
tor-proto: send an outbound meta/control-message and expect similar messages in return.

See merge request tpo/core/arti!1051
2023-03-08 20:09:20 +00:00
Nick Mathewson e08c229412 Merge branch 'suffix' into 'main'
Introduce and use ends_with_ignore_ascii_case

See merge request tpo/core/arti!1058
2023-03-08 19:36:28 +00:00
Nick Mathewson f3b8f4f73f tor-proto: Document limitation on send_control_message 2023-03-08 14:21:33 -05:00
Nick Mathewson c1b45e1be4 tor-proto: Say "control message" a little more consistently
(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.)
2023-03-08 14:21:33 -05:00
Nick Mathewson 9c4bdb8d8d tor-proto: Make send_control_message wait for the reactor.
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.
2023-03-08 14:21:33 -05:00
Nick Mathewson 7da5d7a8d7 Serval rustdoc link fixes. 2023-03-08 14:21:33 -05:00
Nick Mathewson fe6e7e52e3 Fix an unrelated missing cfg_attr. 2023-03-08 14:21:33 -05:00
Nick Mathewson fc31bf4e25 tor-proto: Have send_control_message install a handler, not return a stream 2023-03-08 14:21:33 -05:00
Nick Mathewson bc83d1e1de tor-proto: Implement functionality to send a message and accept replies
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.
2023-03-08 14:21:33 -05:00
Nick Mathewson 094fdc0d8d tor-proto: Change semantics of MetaCellHandler
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`.)
2023-03-08 14:21:33 -05:00
Nick Mathewson 7108f923e0 tor-proto: Give Path a method to access final hop num. 2023-03-08 14:21:33 -05:00
Nick Mathewson 5586a29f62 tor-proto: Give circ Reactor a constructor, and make its fields private. 2023-03-08 14:21:33 -05:00
Nick Mathewson 0df1a4a704 Merge branch 'introduce2_encrypted_portion' into 'main'
tor-cell: Add code for the payload of an hs-ntor handshake.

See merge request tpo/core/arti!1052
2023-03-08 19:20:38 +00:00
Ian Jackson 198a95c74c Merge branch 'host2' into 'main'
arti-client: Do not send resolve requests for IP addrs to exits

See merge request tpo/core/arti!1057
2023-03-08 19:10:23 +00:00
Ian Jackson f15498bc3f arti-client: Host: Be more explicit about what is allowed in Hostname 2023-03-08 18:48:28 +00:00
Ian Jackson c1ae509ce6 Introduce and use ends_with_ignore_ascii_case
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1056#note_2884428
2023-03-08 18:27:42 +00:00
Ian Jackson 80ef1e45a6 Merge branch 'suffix' into 'main'
Introduce and use strip_sufrfix_ignore_ascii_case

See merge request tpo/core/arti!1056
2023-03-08 18:26:14 +00:00
Ian Jackson 939027492e Rustfmt 2023-03-08 18:15:32 +00:00
Ian Jackson 257b761042 Abolish Host::into_string_and_port
When I was trying to add HS support to these layers, I found I could
add a new variant to the `Host` enum but everything would still
compile even though I hadn't written the necessary implementation!

This method is a liability: when using it, one inevitably writes such
latent bugs.
2023-03-08 18:15:32 +00:00