Commit Graph

6806 Commits

Author SHA1 Message Date
Ian Jackson eeaae5a3bf CI: test every crate with default features 2023-06-14 18:47:51 +01:00
Ian Jackson 952bcb11ed CI: add script to test every crate with default features 2023-06-14 18:47:51 +01:00
Nick Mathewson ab56dcf145 Merge branch 'tor-cell-todos' into 'main'
Resolve most TODO HS comments in tor-cell

See merge request tpo/core/arti!1245
2023-06-13 22:30:50 +00:00
gabi-250 677148d077 Merge branch 'hscrypto-todos' into 'main'
hscrypto: Resolve all but one TODO HS comment.

See merge request tpo/core/arti!1244
2023-06-13 18:40:59 +00:00
Nick Mathewson 0912496dbb cell: Downgrade a couple more TODO HS comments. 2023-06-13 13:57:57 -04:00
Nick Mathewson 2fc0f83cdf Merge branch 'rotten-chutney' into 'main'
CI: integration-chutney: Turn into a warning

See merge request tpo/core/arti!1243
2023-06-13 17:06:02 +00:00
Ian Jackson d843aaa3b2 Merge branch '20_byte_sendme_digest' into 'main'
proto: Make sure that auth tags are truncated to 20 bytes

See merge request tpo/core/arti!1242
2023-06-13 17:05:27 +00:00
Nick Mathewson 589fefd581 cell: Remove relaycell::restrict
This module didn't have anything in it; nonetheless, removing it
does count as an API break since it was public.
2023-06-13 13:04:16 -04:00
Nick Mathewson 6a6164a360 cell: Remove some TODOs
Yes, we still will need more accessors for onion services, but we
can add them as we find the need.
2023-06-13 12:58:22 -04:00
Nick Mathewson 0f3724322d cell: remove/localize "allow(dead-code)" 2023-06-13 12:50:09 -04:00
gabi-250 a931c7e5d9 Merge branch 'hs' into 'main'
tor-hsclient: Finish(?) plumbing up first cut of HS client connection

See merge request tpo/core/arti!1240
2023-06-13 16:47:19 +00:00
Nick Mathewson 0add7df458 hscrypto: fix TODOs in time-period code.
* Return a more informative error type (instead of Option)
* Check that time periods are an integer number of seconds
* Decide not to change the semantics of an argument.
2023-06-13 12:39:52 -04:00
Nick Mathewson 0a4dac0fa0 hscrypto: remove compatibility note about time periods.
We updated and clarified the spec in arti!107, and noted the
remaining infelicities in proposal 342.
2023-06-13 12:20:12 -04:00
Nick Mathewson 44ced7dbd3 hscrypto: write a README 2023-06-13 12:15:04 -04:00
Nick Mathewson 848793da5a hscrypto: note that hs_mac is not a good choice for new protocols 2023-06-13 12:11:38 -04:00
Nick Mathewson 7a82285984 hscrypto: comment out an unused key type.
(I'm not removing it entirely since maybe we _should_ use it, and
maybe we _will_ as we do services.  I've added a TODO HS for
removing it or using it, and removed the TODO HS at the head of
pk.rs about making sure that all the key types in the module really
belong there.)
2023-06-13 12:01:12 -04:00
Ian Jackson 69a0efee03 CI: integration-chutney: Turn into a warning
This test is known to fail "when the load is high".  Recently I had to
press the "merge unverified changes" button to merge !1238, after four
consecutivew spurious failures.

IMO this is intolerable.
2023-06-13 16:56:10 +01:00
Nick Mathewson 9888c4422d hscrypto: Remove a TODO about extending an internal macro. 2023-06-13 11:53:29 -04:00
Ian Jackson cc7fd57511 Merge branch 'hs3' into 'main'
tor-hsclient: Plumb some needed values through etc.

See merge request tpo/core/arti!1238
2023-06-13 15:53:01 +00:00
Nick Mathewson 670c73a159 hscrypto: Remove a TODO about implementing ErrorKind.
I think it isn't actually a great idea for HsIdParseError to
implement ErrorKind, since the actual ErrorKind would depend
entirely on where the problematic ID came from.
2023-06-13 11:50:53 -04:00
Nick Mathewson 9311a8da5b hscrypto: clarify and downgrade TODOs about blinding secrets 2023-06-13 11:48:54 -04:00
Ian Jackson bfaf0bba6f tor-hsclient: Add some more debugging 2023-06-13 16:14:57 +01:00
Ian Jackson e123ade035 tor-hsclient: Return the circuit 2023-06-13 16:14:57 +01:00
Ian Jackson 57ba35dfe0 tor-hsclient: Conduct the INTRODUCE1 exchange 2023-06-13 16:14:57 +01:00
Ian Jackson ab11a2042f tor-hsclient: Remove an already-done TODO
Since !1238 we do pass the handshake_state along.
2023-06-13 16:14:57 +01:00
Ian Jackson f76b6eb614 tor-cell: IntroduceAck: Add .success() function to give a Result
The type is a bit odd but this is a result of the underlying protocol.
I don't feel like inventing `IntroduceAckSuccess` that contains only
the extensions.
2023-06-13 16:14:57 +01:00
Ian Jackson 0c10a9554b tor-hsclient: Rename some errors for greater consistency 2023-06-13 16:14:57 +01:00
Ian Jackson d98405d1e0 tor-hsclient: Reorder timeout errors to be "less interesting"
If something *other* than a timeout went wrong, then that is less
expected so more interesting.
2023-06-13 16:14:57 +01:00
Nick Mathewson c79ed2b31b tor-hsclient: Improve proto_oneshot docs 2023-06-13 16:14:06 +01:00
Ian Jackson b1ac10203a tor-hsclient: Pass handshake_state to complete_handcshake (fmt) 2023-06-13 16:14:03 +01:00
Ian Jackson 6810881f38 tor-hsclient: Pass handshake_state to complete_handcshake
Pass Introduced to complete_handshake.  The lack of this was a slip.
Add handshake_state to Introduced, and use it.
2023-06-13 16:13:57 +01:00
Nick Mathewson 40840b1f3a proto: Make sure that auth tags are truncated to 20 bytes
Onion service hops (pointlessly) use SHA3-256 for their
authentication, but they truncate it to 20 bytes (assuming I'm
reading the C right.)

See torspec#204 for clarification here.
2023-06-13 11:04:23 -04:00
Nick Mathewson 864ec4d3ff Merge branch 'fix' into 'main'
RPC: Suppress a warning to do with RPC and SOCKS

See merge request tpo/core/arti!1237
2023-06-13 13:20:19 +00:00
Ian Jackson 85273a7646 tor-hsclient: Add a missing doc
Requested in !1228 but overlooked
2023-06-13 13:22:27 +01:00
Ian Jackson 01259a560b tor-hsclient: Introduce proto_oneshot, to help with message handling (fmt) 2023-06-13 13:22:27 +01:00
Ian Jackson 0dcf872e3a tor-hsclient: Introduce proto_oneshot, to help with message handling
This gets rid of a lot of repeated `oneshot::<...<Result, ...>>` and
a bit of repeated functional code, etc.
2023-06-13 13:22:27 +01:00
Ian Jackson 1587c06790 tor-hsclient: (try to) receive the RENDEZVOUS2 message 2023-06-13 13:00:19 +01:00
Ian Jackson 5d49660e0a RPC: Suppress a warning to do with RPC and SOCKS
Fixes `cargo check`
2023-06-13 12:11:23 +01:00
Ian Jackson 880095356e tor-hsclient: Fix a botched doc comment 2023-06-13 12:00:56 +01:00
Ian Jackson 78de0d279c Merge branch 'msg_in_handler' into 'main'
proto: Convert MsgHandler API to expect a message, not a cell.

Closes #887

See merge request tpo/core/arti!1236
2023-06-13 10:57:01 +00:00
Nick Mathewson beecf3c92c proto: Convert MsgHandler API to expect a message, not a cell.
Closes #887.
2023-06-12 14:55:26 -04:00
Nick Mathewson 47b1083d3a Merge branch 'rpc_pseudomethods_v6' into 'main'
RPC: Functionality to downcast dyn Object to a dyn Trait.

See merge request tpo/core/arti!1225
2023-06-12 18:10:46 +00:00
gabi-250 5480035f51 Merge branch 'desc-validation-err-doc' into 'main'
tor-error: Document another potential cause for OnionServiceDescriptorValidationFailed.

See merge request tpo/core/arti!1215
2023-06-12 18:03:06 +00:00
Nick Mathewson 65f43f3337 Merge branch 'intro_sketch' into 'main'
hsclient: fill in a bunch of introduce/rendezvous logic

See merge request tpo/core/arti!1235
2023-06-12 17:46:50 +00:00
Nick Mathewson 8166a29746 RPC: Functionality to downcast dyn Object to a dyn Trait.
This is a rather tricky piece of functionality.  It works as
follows.

We introduce a `CastTable` type.  Each `CastTable` tells us how to
downcast `dyn Object` for objects of a single concrete type.
The `Object` type now has a `get_casttable` method that returns
an empty `CastTable` by default.

`CastTable` is, internally, a map from the `TypeId` of the target
dyn Trait reference type to a function
`fn(&dyn Object) -> &dyn Trait`.  These functions are stored as
`Box<dyn Any + ...>`.  (They are Boxed because they may refer to
generic functions, which you can't get a static reference to,
and they're Any because the functions have different types.)

The `decl_object!` macro now implements `get_casttable` as
appropriate.  (The syntax is a bit janky, but that's what we get
for not using derive_adhoc.)  For non-generic types, `get_casttable`
uses a Lazy<CastTable>`. to initialize a CastTable exactly once.
For generic types, it use a `Lazy<RwLock<HashMap<..>>` to
build one CastTable per instantiation of the generic type.

This could probably be optimized a bit more, the yaks could be
shaved in a more scintillating hairstyle, and the syntax for
generic `decl_object` could definitely be improved.
2023-06-12 13:35:28 -04:00
Gabriela Moldovan 44fca4c2ca
tor-error: Clarify what we mean by "hostile".
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-06-12 18:25:50 +01:00
Gabriela Moldovan de8ca98900
tor-error: Document another potential cause for OnionServiceDescriptorValidationFailed.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-06-12 18:25:46 +01:00
Nick Mathewson 255d74ac3c hsclient: fill in a lot more introduce/rendezvous logic.
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.
2023-06-12 13:15:59 -04:00
Nick Mathewson 2c8e3b22b5 cell: Add an accessor for the body of a Rendezvous2. 2023-06-12 13:15:59 -04:00
Nick Mathewson f78c5a5a42 proto: Add a commment about a problem in my hs_ntor plans.
I am pretty sure that C tor works around this somehow; we should
figure out how!
2023-06-12 13:15:59 -04:00