Commit Graph

31 Commits

Author SHA1 Message Date
Nick Mathewson 6227539446 cell: Add accessors to IntroduceHandshakePayload 2023-08-16 13:23:46 -04:00
Nick Mathewson 4a5f94daa0 cell: Add accessors to Introduce2. 2023-08-16 10:24:50 -04:00
Nick Mathewson bac156bcf5 cell: Add code to iterate over IntroEstablished extensions 2023-08-15 13:05:53 -04:00
Nick Mathewson 926cc65a9e cell: make establish_intro accept impl<Into<HsMacKey>>
This allows us to allow passing in opaque HsMacKey objects,
rather than untyped byte slices.

Additionally, we now check both MAC and signature unconditionally,
to avoid the large timing side-channel.  The small timing
side-channel of combining booleans with `&` is considered safe.

Part of #993.
2023-08-14 13:15:00 -04:00
Nick Mathewson 27bd990a79 Remove semver.md files for 1.1.6 2023-06-30 10:28:53 -04: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 469f62a983 Remove semver.md files from 1.1.5 2023-06-01 14:08:24 -04:00
Nick Mathewson 7ce808b75b Change CircTarget::linkspecs() to return an encoded list.
If we didn't do this, we would need to transfrom
`EncodedLinkSpec`s into a `LinkSpec::Unrecognized`, which is not
semantically right.  What's more, every user of this API wants to
consume encoded link specifiers, so encoding them early saves a
little effort.
2023-05-10 12:30:32 -04:00
Nick Mathewson 2ab5348ab2 Remove semver.md files. 2023-03-31 09:24:41 -04:00
Nick Mathewson 1254a8b86e tor-cell: Add code for the payload of an hs-ntor handshake.
(This is the encrypted information inside the INTRODUCE2 cell; it's
used by the client to tell the service where to find its rendezvous
point.)
2023-03-06 08:46:40 -05:00
Nick Mathewson 886faa96b3 Remove semver.md files now that 1.1.2 is out. 2023-02-28 10:06:41 -05:00
Nick Mathewson ca3b33a1af tor-cell: Refactor relay cells to copy much less
We now manipulate raw relay cell bodies as (an alias for)
`Box<[u8;509]>` rather than as (an alias for) `[u8;509]`.  This
enables us to do much less copying.  It will become more important
soon, as we defer parsing relay cell bodies even longer.

Related to #7.

We also use SliceWriter to avoid allocating a Vec<> for every relay
message we want to encode, and instead encode directly into the
cell.
2023-02-15 10:48:19 -05:00
Nick Mathewson 16b9d23a7c tor-cell: Make RelayEarly a separate type.
This allows us to remove a shenanigan from `restricted_msg!{}`.
2023-02-09 10:20:28 -05:00
Nick Mathewson b6f6fa4d4b cell: Parameterize ChannelCodec::decode and encode.
This change lets us use ChannelCodec to encode and decode any
restricted channel message type we want.  (Later on, we'll turn the
related Codec class in tor-proto into a more type-restricted version
of this.)
2023-02-09 08:26:09 -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 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 04628ca5ab Remove semver.md files now that 1.1.1 is tagged. 2023-02-01 12:46:01 -05:00
Nick Mathewson c42350c6bf Move tor-proto/semver.md to tor-cell
It was erroneously created in the wrong place.
2023-02-01 09:50:02 -05:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
breezykermo f177f8a02b Add semver.md in tor-cell for MR#793 2022-10-25 11:53:48 +00:00
Nick Mathewson a5f704f443 Remove semver.md from arti-1.0.0 2022-09-07 09:17:00 -04:00
Ian Jackson d9338293c8 Add semver notes 2022-08-17 10:54:41 +01:00
Nick Mathewson b16c042004 Now that versions have bumped, remove semver.md files. 2022-08-01 10:07:12 -04:00
Nick Mathewson a0a88643f8 tor-cell: Make encoding method signatures fallible. 2022-07-11 11:18:51 -04:00
Nick Mathewson 1dda69af2b Remove semver.md files now that 0.5.0 is out 2022-06-24 13:31:38 -04:00
Nick Mathewson 0369995364 tor-cell: convert BytesErr to a struct variant 2022-06-22 15:21:12 -04:00