Nick Mathewson
77cccdfd6e
tor-cell: correct handling of optional msg types.
...
We need to make sure any `#[cfg(feature=...)]` attributes are
applied not only to our variant declarations, but also to the
branches in the match statements that deal with them.
2023-02-07 16:03:14 -05:00
Nick Mathewson
d63d7926bd
tor-cell: Rename RelayMsg and RelayCell-related types.
...
Thanks to rust-analyzer for making this simple.
2023-02-07 16:03:14 -05:00
Nick Mathewson
d99c130679
tor-cell: Rename ChanMsg and ChanCell-related types.
2023-02-07 16:03:14 -05:00
Nick Mathewson
c529bb9c30
tor-cell: Remove RelayMsg methods that are duplicated in RelayMsgClass.
2023-02-07 16:03:14 -05:00
Nick Mathewson
3c7aea723b
tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.
2023-02-07 16:03:14 -05:00
Nick Mathewson
71445f7ace
tor-cell: Use macro to generate ChanMsg too.
2023-02-07 16:03:14 -05:00
Nick Mathewson
706a39a870
tor-cell: Use macro to define RelayMsg type too.
2023-02-07 16:03:14 -05:00
Nick Mathewson
f5f8402d50
tor-cell: Macro to generate restricted RelayMsg and ChanMsg.
...
This is the main implementation part of #525 .
2023-02-07 16:03:14 -05:00
Nick Mathewson
ffb443709b
tor-cell: Change all variants of RelayMsg to have a body.
...
Previously, there were some unit variants, but that makes things
quite awkward for #525 .
2023-02-07 16:03:14 -05:00
Nick Mathewson
afd5232430
tor-cell: Make Body and MsgClass traits more uniform.
...
Doing this will make it much easier to implement a macro that
generates restricted instances of the Msg types (for #525 ).
The Body change is a breaking change. I don't think anybody else
implements Body, but in theory they could.
2023-02-07 16:03:14 -05:00
Nick Mathewson
e099cc7ef8
tor-cell: Generic "Restricted{Relay,Chan}Cell" types.
...
These are generalizations of RelayCell and ChanCell respectively,
that allow using an arbitrary message type in place of the fully
general RelayMsg and ChanMsg types. Doing this is a prerequisite
for usefully implementing arti#525.
2023-02-07 16:03:14 -05:00
Nick Mathewson
3cc7ac45e3
Merge branch 'update_20220207' into 'main'
...
Bump openssl-src to 1.1.1t, and make main CI pass.
See merge request tpo/core/arti!1009
2023-02-07 20:59:19 +00:00
Nick Mathewson
f537a7ad48
Update hsdesc parser code to new sectionrules::builder code.
2023-02-07 15:28:10 -05:00
Nick Mathewson
698b997228
Bump openssl-src to 1.1.1t.
2023-02-07 15:16:44 -05:00
eta
85ca3e41b9
Merge branch 'shadykaty-error-hint-v2' into 'main'
...
Create and use an ErrorHint type to report how to fix a problem.
Closes #579 and #578
See merge request tpo/core/arti!994
2023-02-07 16:32:10 +00:00
eta
87d3deb3d3
Merge branch 'env-check' into 'main'
...
maint: add shebang
See merge request tpo/core/arti!990
2023-02-07 16:19:34 +00:00
eta
c7c4fff66e
Merge branch 'authcert_bug' into 'main'
...
Fix AuthCert behavior on unrecognized tokens, and prevent bug from recurring elsewhere.
Closes #752
See merge request tpo/core/arti!1006
2023-02-07 16:06:20 +00:00
Nick Mathewson
ba85d99766
Merge branch 'parse_hsdesc' into 'main'
...
Onion service descriptor parsing and decoding, first cut.
See merge request tpo/core/arti!999
2023-02-07 14:30:50 +00:00
Nick Mathewson
a1c36b2087
netdoc: Add a comment about renaming layer to document.
2023-02-07 09:02:15 -05:00
Nick Mathewson
257aaf9e5b
netdoc::hsdesc: rename Passwd to Password.
2023-02-07 09:02:15 -05:00
Nick Mathewson
2ba28aa289
netdoc: Rename/comment objects from hsdesc.
2023-02-07 09:02:15 -05:00
Nick Mathewson
d10ccf0dc5
netdoc: Rename/comment objects from inner_layer.
2023-02-07 09:02:15 -05:00
Nick Mathewson
1cdd36f511
netdoc: Rename/comment objects from middle_layer.
2023-02-07 09:02:15 -05:00
Nick Mathewson
1a59005ae0
netdoc: Rename/comment objects from desc_enc
2023-02-07 09:02:15 -05:00
Nick Mathewson
7701e02aad
netdoc: Renaming and comments in outer_layer.
2023-02-07 09:02:15 -05:00
Nick Mathewson
68d2ccf5fe
netdoc: Use Itertools::exactly_once in hsdesc parsing
2023-02-07 09:02:15 -05:00
Nick Mathewson
3d53a30c94
netdoc: Remove useless should_be_exhausted calls.
2023-02-07 09:02:15 -05:00
Nick Mathewson
cff2326f6f
Remove a needless line.
2023-02-07 09:02:15 -05:00
Nick Mathewson
fbffd3168c
Even more clarifying comments.
2023-02-07 09:02:15 -05:00
Nick Mathewson
328535855a
netdoc: Try to add a bunch of clarifying documentation.
...
In the process I found a couple of keys without identifiers in the
spec.
2023-02-07 09:02:15 -05:00
Nick Mathewson
6954c6b488
netdoc: Use Signature::from to construct ed25519 sigs.
2023-02-07 09:02:15 -05:00
Nick Mathewson
4c24f8e8a2
netdoc: Clear up a few typos in hsdesc comments and strings.
2023-02-07 09:02:15 -05:00
Nick Mathewson
d699742400
netdoc: Implement onion service descriptor parsers.
2023-02-07 09:02:15 -05:00
Nick Mathewson
2b82011dfb
tor-checkable: Add dangerously_map() functions.
...
These functions consume a checkable wrapper, and return a new
checkable wrapper with mapped contents but the same not-yet-checked
constraints.
As documented, They are "dangerous" because the provided function
gets access to the contents before they are checked; the caller has
to make sure that the provided function doesn't expose their
contents inappropriately.
2023-02-07 09:02:15 -05:00
Nick Mathewson
23757d90c1
netdoc: Parse the inner layer of an onion service descriptor.
...
There are some places where I note certificates which are not
currently validated, because there is no cryptographic point in
doing so. We should either document that this is okay, or validate
the certificates anyway.
This code might benefit from refactoring to make it prettier.
2023-02-07 09:02:15 -05:00
Nick Mathewson
6817f61641
netdoc: Add a workaround for C Tor's lack of mid-layer NL
...
It turns out that C Tor doesn't add a newline at the end of the
middle layer of an onion service descriptor. I've made a spec MR
(torspec!109) to document this: here, it's time to work around the
issue.
2023-02-07 09:02:15 -05:00
Nick Mathewson
4be4d178fa
netdoc: Parse the middle layer of a hsdesc, and decrypt it.
2023-02-07 09:02:15 -05:00
Nick Mathewson
321c8582ce
netdoc: Use correct size for descriptor encryption cookie
2023-02-07 09:02:15 -05:00
Nick Mathewson
d8849f583e
netdoc: move test descriptor to a higher level test module
...
We're going to make use of it in all of our tests, so we may as well
expose it to them from hsdesc::test.
2023-02-07 09:02:15 -05:00
Nick Mathewson
02fa682bc0
netdoc: implement onion service descryptor encryption
...
This is tested via a round-trip check, and via a successful
decryption of our example descriptor's outer layer.
2023-02-07 09:02:13 -05:00
Nick Mathewson
6c4e9c8f1d
netdoc: Parser for outer layer of onion service descriptors.
2023-02-07 09:00:19 -05:00
Nick Mathewson
d35e8a751d
netdoc: Add an example onion service descriptor to test our parsing.
...
I generated this using C tor (latest main) and a Chutney network
about a week ago.
The subcredential is:
78210A0D2C72BB7A0CAF606BCD938B9A3696894FDDDBC3B87D424753A7E3DF37
The HS_blind_id is:
43CC0D62FC6252F578705CA645A46109E265290343B1137E90189744B20B3F2D
2023-02-07 09:00:19 -05:00
Nick Mathewson
0f1cfc308a
netdoc: Derive Debug and Clone on HsDesc and its kin.
2023-02-07 09:00:19 -05:00
Nick Mathewson
4c0be7c568
hscrypto: Impl From<Ed25519Identity> for BlindedOnionId.
2023-02-07 09:00:19 -05:00
Nick Mathewson
3ce5ee1499
hscrypto: add From/Into between RevisionCounter and u64.
2023-02-07 09:00:19 -05:00
Nick Mathewson
a751eacd5b
tor-cert: document hs-related certificate types.
...
Also, explain why a few of these certificates aren't actually useful
as certificates. (This issue is also documented in torspec!110)
2023-02-07 09:00:19 -05:00
Nick Mathewson
079002d283
tor-cert: Implement Timebound for Ed25519Cert
...
This allows us to run `is_valid_at` and friends on the certificate
itself, which we will use soon in hsdesc validity checks.
2023-02-07 09:00:19 -05:00
Nick Mathewson
59b981ea5e
llcrypto: Implement `Into<[u8;32]>` for Ed25519Identity
2023-02-07 09:00:19 -05:00
Nick Mathewson
72448b704a
llcrypto: Derive zeroize for CtByteArray.
2023-02-07 09:00:19 -05:00
Nick Mathewson
ac7ea9d44d
Merge branch 'warning' into 'main'
...
tor-netdoc: Suppress a cfg-dependent dead code warning
See merge request tpo/core/arti!998
2023-02-07 12:49:18 +00:00