summaryrefslogtreecommitdiff
path: root/crates/tor-cell
Commit message (Collapse)AuthorAgeFilesLines
...
| * Make a comment more accurateIan Jackson2023-02-161-1/+3
| |
| * tor-cell: Use a more generic mechanism for managing extensionsNick Mathewson2023-02-154-79/+264
| | | | | | | | | | | | | | | | | | | | Several HS message types have an extension list type. They all use the same framing for extensions, but each of them has separate extension types and separate extension namespaces. This commit simplifies establish_intro a little, and adds support for maintaining unrecognized extension types--at the expense of some new internal code.
| * tor-cell: Extract establish-intro into its own module.Nick Mathewson2023-02-154-215/+223
| | | | | | | | | | | | | | Some of the HS message types have a lot of dependent types, like extensions and options for those extensions, and so on. Except when those extensions are portable across cell types, it makes sense to put them in their own modules.
| * tor-cell: rename onion_service module to hsNick Mathewson2023-02-154-7/+7
| |
* | tor-cell: add a TODO comment about simplifying Body away.Nick Mathewson2023-02-152-0/+8
| |
* | tor-cell: Add another debug_assert to relay cell encodingNick Mathewson2023-02-151-3/+6
| |
* | slicewriter: rename a local variable.Nick Mathewson2023-02-151-4/+4
| |
* | Move slicewriter to tor-cell and make it private.Nick Mathewson2023-02-153-1/+137
| | | | | | | | Also, add some comments about how it is likely to change.
* | tor-cell: Add RelayCell::into_msg.Nick Mathewson2023-02-151-0/+4
| |
* | tor-cell: Implement {Relay,Chan}Msg for every body typeNick Mathewson2023-02-153-5/+97
| | | | | | | | | | This will make it ergonomic to decode a single body type without having to declare a variant that accepts only a single message.
* | tor-cell: Note an opportunity for future optimizationNick Mathewson2023-02-151-0/+5
| |
* | tor-cell: Add a new UnparsedRelayCellNick Mathewson2023-02-152-2/+60
| | | | | | | | | | | | We'll use this to router relay messages on a circuit to the appropriate stream, and hand them to that stream, without parsing the message until the stream has been determined.
* | tor-cell: Refactor relay cells to copy much lessNick Mathewson2023-02-155-42/+70
|/ | | | | | | | | | | | | 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.
* tor-cell: Return a useful error when restrist_msg rejects a command.Nick Mathewson2023-02-091-2/+3
|
* Change tor_bytes::Error::BadMessage to a Cow.Nick Mathewson2023-02-0910-34/+51
| | | | | | | | | | Actually, to avoid making a breaking change, I'm deprecating BadMessage and creating a new InvalidMessage variant that takes a Cow. This way I don't need to track every crate that re-exposes tor_bytes::Error and call this a breaking change in those. Making this change will allow tor_bytes errors to be much more helpful.
* tor-cell: Re-export paste so restrict_msg can work outside the crate.Nick Mathewson2023-02-091-3/+3
|
* tor-cell: Remove chancell::msg::Body::into_message.Nick Mathewson2023-02-091-52/+1
| | | | | It's now redundant, since `restricted_msg!` defines From and Into for us.
* tor-cell: Make RelayEarly a separate type.Nick Mathewson2023-02-094-8/+32
| | | | This allows us to remove a shenanigan from `restricted_msg!{}`.
* tor-cell: Have restrict_msg add conversion functions.Nick Mathewson2023-02-095-102/+70
| | | | | | | | | | | | | | | | Every FooMsg type now implements Into<AnyFooMsg>, and TryFrom<FooMsg>. Additionally, it now implements From<X> for every distinct type that it supports. This last part lets us discard a bunch of code. Unfortunately, I needed some downright hackish trickery in order to get these macros to avoid generating `From<AnyFooMsg> for AnyFooMsg` and conflicting with the blanket implementation. The trickery to deal with RelayEarly and Relay being the same type was not necessarily worth it; I will be separating them and removing said trickery in the next commit.
* cell: Parameterize ChannelCodec::decode and encode.Nick Mathewson2023-02-093-12/+21
| | | | | | | 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.)
* tor-cell: documentation cleanups related to restricted_msgNick Mathewson2023-02-074-6/+8
|
* tor-cell: correct handling of optional msg types.Nick Mathewson2023-02-072-12/+17
| | | | | | 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.
* tor-cell: Rename RelayMsg and RelayCell-related types.Nick Mathewson2023-02-078-79/+80
| | | | Thanks to rust-analyzer for making this simple.
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-077-65/+66
|
* tor-cell: Remove RelayMsg methods that are duplicated in RelayMsgClass.Nick Mathewson2023-02-074-17/+3
|
* tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.Nick Mathewson2023-02-075-33/+11
|
* tor-cell: Use macro to generate ChanMsg too.Nick Mathewson2023-02-073-108/+38
|
* tor-cell: Use macro to define RelayMsg type too.Nick Mathewson2023-02-072-185/+103
|
* tor-cell: Macro to generate restricted RelayMsg and ChanMsg.Nick Mathewson2023-02-073-0/+198
| | | | This is the main implementation part of #525.
* tor-cell: Change all variants of RelayMsg to have a body.Nick Mathewson2023-02-073-15/+53
| | | | | Previously, there were some unit variants, but that makes things quite awkward for #525.
* tor-cell: Make Body and MsgClass traits more uniform.Nick Mathewson2023-02-077-85/+88
| | | | | | | | 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.
* tor-cell: Generic "Restricted{Relay,Chan}Cell" types.Nick Mathewson2023-02-074-33/+101
| | | | | | | 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.
* Remove semver.md files now that 1.1.1 is tagged.Nick Mathewson2023-02-011-2/+0
|
* Bump minor version of tor-cell.Nick Mathewson2023-02-011-1/+1
| | | | | | | | | In !948 we renamed a couple of accessor functions, which is a breaking change in `tor-cell`'s API. In retrospect, perhaps we should have deprecated the old names and added the new ones, so we wouldn't have to break the API. (This is the only API break AFAICT since 1.1.0.)
* Bump the patch version of every crate that had API additionsNick Mathewson2023-02-011-4/+4
| | | | | | These crates had API or behavior changes that may affect downstream crates. Fortunately, they're all version 0.x, and don't need minor bumps for this.
* Bump the patch-level version of crates with _minor_ changes.Nick Mathewson2023-02-011-1/+1
| | | | | | | These changes influence behavior, but not effect compatibility. (If I messed up, and any crate except for `arti` has non-breaking API changes, that's still fine, since they are all version 0.x.)
* Move tor-proto/semver.md to tor-cellNick Mathewson2023-02-011-0/+2
| | | | It was erroneously created in the wrong place.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-275-0/+7
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Do not .gitignore crates/*/fuzz/corpusIan Jackson2023-01-201-1/+0
| | | | | These are symlinks which are actually checked in. They should not be ignored. (This caused trouble for some of my privsep tooling...)
* Fix typosDimitris Apostolou2023-01-071-4/+4
|
* Sketch a solution for arti#525Nick Mathewson2023-01-062-0/+35
|
* Sketch out new required APIs in tor-cellNick Mathewson2023-01-063-10/+129
|
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+9
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | msg::{CreateFast/CreatedFast}: Rename accessor to (into_)body()Neel Chauhan2022-12-182-4/+4
|/
* Remove semver.md files now that 1.1.0 is released.Nick Mathewson2022-11-301-1/+0
|
* Bump the minor version of every crate.Nick Mathewson2022-11-301-9/+9
| | | | | We made this job easy this time around: by incrementing our MSRV, we have forced ourselves to do at least a minor bump everywhere.
* bump rust-version to 1.60 in every crate.Nick Mathewson2022-11-101-1/+1
|
* Fix typosDimitris Apostolou2022-11-061-1/+1
|