Commit Graph

145 Commits

Author SHA1 Message Date
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
Dimitris Apostolou 9c7d1802f5
Fix typos 2022-11-06 06:51:58 +02:00
Nick Mathewson 932fe48eaf Run add_warnings. 2022-11-03 11:06:02 -04:00
trinity-1686a d29f38603d set all crate edition to 2021 2022-11-01 00:17:33 +01:00
Nick Mathewson 9f73ddd440 Merge branch 'assert_maxlen' into 'main'
tor-cell: Assert data length in Data cells

See merge request tpo/core/arti!800
2022-10-27 01:46:21 +00:00
Nick Mathewson 49ffb1cf4b Merge branch 'safe_u16_conversion' into 'main'
tor-cell: Consistent and secure conversion to u16

See merge request tpo/core/arti!803
2022-10-25 13:17:55 +00:00
Nick Mathewson 49f0521904 Merge branch 'rename_for_to_from' into 'main'
tor-cell: Rename for_client and for_relay

See merge request tpo/core/arti!793
2022-10-25 11:53:57 +00:00
Nick Mathewson 303727081b Merge branch 'feat/add-semvermd-tor-cell' into 'main'
Add semver.md in tor-cell for MR#793

See merge request tpo/core/arti!798
2022-10-25 11:53:48 +00:00
breezykermo f177f8a02b Add semver.md in tor-cell for MR#793 2022-10-25 11:53:48 +00:00
eta 378a4999ad Merge branch 'fix_typos' into 'main'
tor-cell: Fix typos in msg.rs

See merge request tpo/core/arti!802
2022-10-25 10:36:07 +00:00
Emil Engler 05cad9f6d7
tor-cell: Add comment explaing Data::MAXLEN
This commit adds a comment explaining composition of the magic number
"11" found in the assignment of the Data::MAXLEN constant.
2022-10-24 14:46:32 +02:00
Emil Engler cc8b9e446f
tor-cell: Fix typos in msg.rs 2022-10-24 14:45:48 +02:00
Emil Engler c42a55d515
tor-cell: Consistent and secure conversion to u16
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.
2022-10-24 14:40:51 +02:00
Emil Engler fb2195b0cf
tor-cell: Assert data length in Data cells
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.
2022-10-24 13:33:24 +02:00
eta b031616b5f Merge branch 'fix_typos' into 'main'
tor-cell: Fix typos in msg.rs

See merge request tpo/core/arti!788
2022-10-21 20:21:28 +00:00
eta 533ff7bda2 Merge branch 'remove_redundant' into 'main'
tor-cell: Remove redundant match clauses

See merge request tpo/core/arti!792
2022-10-21 20:17:37 +00:00
eta 81525c345a Merge branch 'concrete_comments' into 'main'
tor-cell: Make historical comments more concrete

See merge request tpo/core/arti!787
2022-10-21 20:16:27 +00:00
Ian Jackson a4e65d38e1 Merge branch 'no_redundant_copy' into 'main'
tor-cell: Avoid redundant pointer copy

See merge request tpo/core/arti!791
2022-10-21 17:51:25 +00:00
Nick Mathewson a12667e077 Merge branch 'no_redundant_allocation' into 'main'
tor-cell: Avoid redundant allocation

See merge request tpo/core/arti!790
2022-10-21 12:18:49 +00:00
Emil Engler 169ed860c2
tor-cell: Avoid redundant pointer copy
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.
2022-10-21 13:26:00 +02:00
Emil Engler c489e1d911
tor-cell: Avoid redundant allocation
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.
2022-10-21 13:25:26 +02:00
Emil Engler e5429a2891
tor-cell: Rename for_client and for_relay
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.
2022-10-21 13:21:52 +02:00
Emil Engler 17759799f1
tor-cell: Remove redundant match clauses
This commit removes two redundant match clauses inside the
take_one_netinfo_addr function found inside msg.rs.
2022-10-21 13:17:43 +02:00
Emil Engler f423721cc3
tor-cell: Rename fixed_len to fixed_len_handshake
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.
2022-10-21 13:14:50 +02:00
Emil Engler 247cc37290
tor-cell: Fix typos in msg.rs 2022-10-21 13:10:30 +02:00
Emil Engler 7e04de6d96
tor-cell: Make historical comments more concrete
This commit extends comments that make references to historical protocol
versions of Tor, by adding the concrete protocol version numbers.
2022-10-21 12:59:26 +02:00
Nick Mathewson 5786637b4f Fix various typos (using typos tool and hand-inspection) 2022-10-18 15:39:33 -04:00
Ian Jackson f84d8777db cargo fmt to remove blank lines
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.

This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson d9910dba08 Replace all README copies in src/lib.rs with includes
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
2022-10-12 15:29:03 +01:00
Nick Mathewson c41305d110 tor-cell fuzzer: test more features. 2022-10-06 15:48:45 -04:00
Nick Mathewson 128fb76c73 Upgrade all fuzzers to newer libfuzzer-sys version. 2022-10-03 14:35:34 -04:00
Nick Mathewson 388e0cbab5 Bump crates that have had backward compatible API changes. 2022-10-03 09:52:34 -04:00
Ian Jackson 0154d82522 Merge branch 'cell-introduce2' into 'main'
Implement Introduce2 tor cell

See merge request tpo/core/arti!736
2022-09-26 12:07:33 +00:00
Yuan Lyu 6e5874d15b
Implement Introduce2 tor cell
Reuse the same Introduce inner body implementation
of Introduce1.
2022-09-21 00:34:13 -04:00
Nick Mathewson 3e922e5ede Intoduce1: Use a constant-time check for all-zero RsaIdentity
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.
2022-09-20 09:36:49 -04:00
Nick Mathewson 7715b9c8d6 Merge branch 'cell-introduce1' into 'main'
Implement onion service Introduce1

See merge request tpo/core/arti!724
2022-09-20 13:02:02 +00:00
Yuan Lyu 1a3b979ecf
Implement onion service Introduce1 2022-09-08 23:48:56 -04:00
Nick Mathewson a5f704f443 Remove semver.md from arti-1.0.0 2022-09-07 09:17:00 -04:00
Nick Mathewson 96875ea208 Bump crate versions in preparation for Arti 1.0.0 release.
Because we want to work more on ensuring that our semver stability
story is solid, we are _not_ bumping arti-client to 1.0.0 right now.

Here are the bumps we _are_ doing.  Crates with "minor" bumps have
had API breaks; crates with "patch" bumps have had new APIs added.

Note that `tor-congestion` is not bumped here: it's a new crate, and
hasn't been published before.

```
tor-basic-utils         minor
fs-mistrust             minor
tor-config              minor
tor-rtcompat            minor
tor-rtmock              minor
tor-llcrypto            patch
tor-bytes               patch
tor-linkspec            minor
tor-cell                minor
tor-proto               minor
tor-netdoc              patch
tor-netdir              minor
tor-persist             patch
tor-chanmgr             minor
tor-guardmgr            minor
tor-circmgr             minor
tor-dirmgr              minor
arti-client             minor
arti-hyper              minor
arti                    major
arti-bench              minor
arti-testing            minor
```
2022-09-01 08:59:49 -04:00
Yuan Lyu 08e55bc9b1
Clean up EstablishIntro cell 2022-08-25 16:45:40 -04:00
trinity-1686a 7f939fa480 enable doc_auto_cfg feature on every crate when documenting for docs.rs 2022-08-24 18:22:41 +02:00
Ian Jackson d9338293c8 Add semver notes 2022-08-17 10:54:41 +01:00
Ian Jackson 14c6e17797 tor-cell: PaddingNegotiate::start: take IntegerMilliseconds 2022-08-17 10:54:41 +01:00
Ian Jackson bdaee82187 tor-cell: PaddingNegotiate: give better spec xrefs 2022-08-17 10:54:41 +01:00
Ian Jackson 7ed983800d channel padding: Rename low_ms and high_ms
These have the unit in the type.  Putting that in the field name too
is otiose.
2022-08-17 10:54:41 +01:00
Ian Jackson 76403563e5 tor-cell, testing: Provide PaddingNegotiate::from_raw
This allows test cases to describe precisely the contents of the
negotiation cell ought to be generated.
2022-08-16 18:43:23 +01:00
Ian Jackson 38b76578be chancell: PaddingNegotiate: Provide start_default and a Default impl
As proposed in
  https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/77
2022-08-16 18:37:06 +01:00
Ian Jackson a26f341bd7 chancell: Introduce PaddingNegotiateCmd
This gets rid of some random hardcoded literals.  We're going to want
to reuse this, too.
2022-08-16 18:37:06 +01:00
Ian Jackson 0df72449b8 chancell: PaddingNegotiate: Provide two constructors, not one
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
2022-08-16 18:37:06 +01:00
Ian Jackson ecd6f16b6e chancell: PaddingNegotiate: Make Eq
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.
2022-08-16 18:37:06 +01:00