summaryrefslogtreecommitdiff
path: root/crates/tor-cell/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-271-0/+1
| | | | | | | | 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.
* 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-062-8/+124
|
* 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-181-2/+2
|/
* Fix typosDimitris Apostolou2022-11-061-1/+1
|
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Merge branch 'assert_maxlen' into 'main'Nick Mathewson2022-10-271-1/+2
|\ | | | | | | | | tor-cell: Assert data length in Data cells See merge request tpo/core/arti!800
| * tor-cell: Assert data length in Data cellsEmil Engler2022-10-241-1/+2
| | | | | | | | | | | | This commit adds a `debug_assert!` macro into the `new_unchecked()` function of the Data cell. Beside this, it also fixes a misleading comment regarding that limit.
* | Merge branch 'safe_u16_conversion' into 'main'Nick Mathewson2022-10-251-1/+1
|\ \ | | | | | | | | | | | | tor-cell: Consistent and secure conversion to u16 See merge request tpo/core/arti!803
| * | tor-cell: Consistent and secure conversion to u16Emil Engler2022-10-241-1/+1
| |/ | | | | | | | | | | | | This commit improves the overflow protection of one call to Vec::write_u16(), by replacing the cast conversion from self.sig.len() with a call to u16::try_from(), like it is already done in the rest of the accompanying function.
* | Merge branch 'rename_for_to_from' into 'main'Nick Mathewson2022-10-251-2/+2
|\ \ | | | | | | | | | | | | tor-cell: Rename for_client and for_relay See merge request tpo/core/arti!793
| * | tor-cell: Rename for_client and for_relayEmil Engler2022-10-211-2/+2
| | | | | | | | | | | | | | | | | | | | | This commit renames the for_client and for_relay functions to from_client and from_relay respectively, in order to indicate their origin, as the term "for" is more likely to indicate a destination, which is not true in that situation.
* | | Merge branch 'fix_typos' into 'main'eta2022-10-251-2/+2
|\ \ \ | | | | | | | | | | | | | | | | tor-cell: Fix typos in msg.rs See merge request tpo/core/arti!802
| * | | tor-cell: Fix typos in msg.rsEmil Engler2022-10-241-2/+2
| | |/ | |/|
* / | tor-cell: Add comment explaing Data::MAXLENEmil Engler2022-10-241-0/+1
|/ / | | | | | | | | This commit adds a comment explaining composition of the magic number "11" found in the assignment of the Data::MAXLEN constant.
* | Merge branch 'fix_typos' into 'main'eta2022-10-211-3/+3
|\ \ | | | | | | | | | | | | tor-cell: Fix typos in msg.rs See merge request tpo/core/arti!788
| * | tor-cell: Fix typos in msg.rsEmil Engler2022-10-211-3/+3
| |/
* | Merge branch 'remove_redundant' into 'main'eta2022-10-211-2/+0
|\ \ | | | | | | | | | | | | tor-cell: Remove redundant match clauses See merge request tpo/core/arti!792
| * | tor-cell: Remove redundant match clausesEmil Engler2022-10-211-2/+0
| |/ | | | | | | | | This commit removes two redundant match clauses inside the take_one_netinfo_addr function found inside msg.rs.
* | Merge branch 'concrete_comments' into 'main'eta2022-10-212-7/+12
|\ \ | | | | | | | | | | | | tor-cell: Make historical comments more concrete See merge request tpo/core/arti!787
| * | tor-cell: Make historical comments more concreteEmil Engler2022-10-212-7/+12
| |/ | | | | | | | | This commit extends comments that make references to historical protocol versions of Tor, by adding the concrete protocol version numbers.
* | Merge branch 'no_redundant_copy' into 'main'Ian Jackson2022-10-211-2/+2
|\ \ | | | | | | | | | | | | tor-cell: Avoid redundant pointer copy See merge request tpo/core/arti!791
| * | tor-cell: Avoid redundant pointer copyEmil Engler2022-10-211-2/+2
| |/ | | | | | | | | | | This commit changes an iteration by copying a u16 (which is 2 bytes) instead of a pointer address, which is most likely 8 bytes on most machines.
* | Merge branch 'no_redundant_allocation' into 'main'Nick Mathewson2022-10-211-1/+1
|\ \ | | | | | | | | | | | | tor-cell: Avoid redundant allocation See merge request tpo/core/arti!790
| * | tor-cell: Avoid redundant allocationEmil Engler2022-10-211-1/+1
| |/ | | | | | | | | | | This commit changes the way how a vector with a known sized gets allocated, by using Vec::with_capacity() instead of Vec::new(). It will eventually avoid an allocation of more memory than required.
* / tor-cell: Rename fixed_len to fixed_len_handshakeEmil Engler2022-10-211-7/+7
|/ | | | | | This commit renames the fixed_len! macro to fixed_len_handshake!, in order to indicate, that this macro is only suited for cells with commands related to handshaking.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-58/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Merge branch 'cell-introduce2' into 'main'Ian Jackson2022-09-262-15/+64
|\ | | | | | | | | Implement Introduce2 tor cell See merge request tpo/core/arti!736
| * Implement Introduce2 tor cellYuan Lyu2022-09-212-15/+64
| | | | | | | | | | Reuse the same Introduce inner body implementation of Introduce1.
* | Intoduce1: Use a constant-time check for all-zero RsaIdentityNick Mathewson2022-09-201-2/+3
|/ | | | | | | | | | | | As a matter of good crypto practice, we shouldn't use short-circuiting checks to compare keys or key-like objects, since the amount of time taken by those checks can leak information about their inputs. I don't think it's actually _necessary_ to use a constant-time operation in this case, but let's establish the precedent. This is a follow-up to !724.
* Implement onion service Introduce1Yuan Lyu2022-09-082-1/+74
|
* Clean up EstablishIntro cellYuan Lyu2022-08-251-12/+162
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* tor-cell: PaddingNegotiate::start: take IntegerMillisecondsIan Jackson2022-08-171-3/+4
|
* tor-cell: PaddingNegotiate: give better spec xrefsIan Jackson2022-08-171-0/+6
|
* channel padding: Rename low_ms and high_msIan Jackson2022-08-171-1/+5
| | | | | These have the unit in the type. Putting that in the field name too is otiose.
* tor-cell, testing: Provide PaddingNegotiate::from_rawIan Jackson2022-08-161-0/+8
| | | | | This allows test cases to describe precisely the contents of the negotiation cell ought to be generated.
* chancell: PaddingNegotiate: Provide start_default and a Default implIan Jackson2022-08-161-0/+20
| | | | | As proposed in https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/77
* chancell: Introduce PaddingNegotiateCmdIan Jackson2022-08-161-5/+17
| | | | | This gets rid of some random hardcoded literals. We're going to want to reuse this, too.
* chancell: PaddingNegotiate: Provide two constructors, not oneIan Jackson2022-08-161-7/+14
| | | | | | | | We don't really want the caller to pass ignored timeout parameters. And this makes more semantic sense. The stop constructor uses zero, which is what C Tor does. See https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/76
* chancell: PaddingNegotiate: Make EqIan Jackson2022-08-161-2/+2
| | | | | | | | This will be convenient for managing when to send these negotiation messages. While we're here, edit the comment to explain how this is (going to be) used.
* Clarify `REASON_DONE`Emptycup2022-08-161-1/+1
|
* Implement establish rendezvous cellYuan Lyu2022-08-052-1/+42
|
* Several typo fixes from `typos`.Nick Mathewson2022-07-271-1/+1
|
* Fix compilation of EstablishInto encoding.Nick Mathewson2022-07-221-2/+3
| | | | It was based on the old `Writeable` API.