Commit Graph

363 Commits

Author SHA1 Message Date
Nick Mathewson 11caa46525 tor-linkspec: ByRelayIds<> type to hold a set of HasRelayIds
This is based on the type generated with n_key_set, with a
couple of extra methods to take advantage of RelayId and RelayIdRef.
2022-10-04 16:05:40 -04:00
Nick Mathewson 0d985b0def Merge branch 'hostname-validation' into 'main'
Use hostname-validator crate for hostname validation

See merge request tpo/core/arti!739
2022-10-03 19:01:56 +00:00
Nick Mathewson 7402578af4 Merge branch 'multi_keyed_set' into 'main'
Include a HashSet variant that can be keyed on multiple keys.

See merge request tpo/core/arti!747
2022-10-03 18:16:10 +00:00
Nick Mathewson c2d4b4ed3b Include a HashSet variant that can be keyed on multiple keys.
Every element in the set has up to N keys, each of which may have differnt
types.  No value for any key may correspond to more than one element in
the set.

These properties can be provided, via a macro, for values of N between 1
and $BIG_ENOUGH.

We'll use this to implement a type that holds HasRelayIds.
2022-10-03 13:30:37 -04:00
Nick Mathewson 05868fea7f Merge branch 'socks_client' into 'main'
Implement a SOCKS client handshake

See merge request tpo/core/arti!746
2022-10-03 17:23:24 +00:00
Nick Mathewson f12202d707 Make sure that socks4 auth doesn't have any 0 bytes.
Try to do it in constant time, to avoid even the smell of
side-channel attacks.
2022-10-03 12:52:38 -04:00
Nick Mathewson dc55272602 Fuzzer code for socks client implementation. 2022-10-03 12:52:38 -04:00
Reylaba 6a6931e2c3 Use hostname-validator crate for hostname validation 2022-10-03 16:47:03 +02:00
Nick Mathewson f2658437ff Oops: propagate bumps to Cargo.lock. 2022-10-03 10:15:37 -04:00
Nick Mathewson c1e70b7af4 Bump patchlevels of binary crates.
Since these don't expose any Runtime-based APIs, they don't have
a breaking change.
2022-10-03 10:07:19 -04:00
Nick Mathewson 102e3c221d Bump minor version of tor-rtcompat and most of its dependents
(Since the APIs for the `Schedule::sleep*` functions changed, this
is a breaking change in tor-rtcompat.  Therefore, the Runtime trait
in tor-rtcompat is now a different trait.  Therefore, anything that
uses the Runtime trait in its APIs has also broken.)
2022-10-03 10:01:46 -04:00
Nick Mathewson 388e0cbab5 Bump crates that have had backward compatible API changes. 2022-10-03 09:52:34 -04:00
Nick Mathewson 627a8f09bd Run cargo update in preparation for upcoming release. 2022-09-30 15:19:39 -04:00
Nick Mathewson 66ddbee1a4 Upgrade dependencies in preparation for upcoming release 2022-09-30 15:19:32 -04:00
Nick Mathewson e412d7400c Add the skeleton of a tor-ptmgr crate
When complete, this crate will handle launching and using pluggable
transports on demand.
2022-09-23 14:08:24 -04:00
Nick Mathewson 63dbc7b22d Create an API for TransportId 2022-09-23 09:55:33 -04:00
trinity-1686a edfd416ba4 enumerate platform with getresuid support 2022-09-10 14:13:26 +02:00
eta d9c140992f Merge branch 'fix-async-std' into 'main'
fix compilation error with async-std

See merge request tpo/core/arti!723
2022-09-07 17:16:28 +00:00
Nick Mathewson 86e479ae13 `TaskSchedule`: give error on `sleep*()` if last handle is dropped
This fixes an busy-loop.

When the last `TaskHandle` on a `TaskSchedule` is dropped, the
schedule is permanently canceled: whatever operation it was
scheduling should no longer be performed.  But our code was broken:
the `sleep()` and `sleep_until_wallclock()` functions don't verify
whether the handles are dropped or not.

This breakage caused an CPU-eating busy-loop in
`sleep_until_wallclock`.

With this patch, we now return a `Result<(), SleepError>` from these
functions.

Fixes #572.
2022-09-07 09:22:38 -04:00
trinity-1686a 4c543b570a fix compilation error with async-std 2022-09-06 21:32:20 +02:00
Ian Jackson 905aa29a9f Merge branch 'update-notify' into 'main'
update to notify v5.0.0

Closes #454

See merge request tpo/core/arti!679
2022-09-01 16:18:20 +00: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
Nick Mathewson b3f989d689 Update patch-versions on crates without API changes.
Since our last round of releases, these crates have had either
trivial changes, or changes that did not affect their APIs.
Therefore we are bumping their versions, but not changing which
versions of them other crates depend on.
2022-09-01 08:45:02 -04:00
trinity-1686a e1e3f912b3 update to v5.0.0 2022-08-31 19:08:06 +02:00
Nick Mathewson 03a6338ee0 Run cargo update again, in preparation for release 2022-08-31 11:09:26 -04:00
Nick Mathewson 77cb5acceb Merge branch 'compact_home_2' into 'main'
Represent the home directory as ${HOME} or %UserProfile%

Closes #555

See merge request tpo/core/arti!700
2022-08-31 13:57:11 +00:00
Nick Mathewson 7888ca09d2 fs-mistrust: Add a `anonymize_home` extension fn for Path.
This function transforms `/home/nickm/.config` to
`${HOME}/.config/`, so that we can expose the username less in our
logs.
2022-08-31 09:38:09 -04:00
Nick Mathewson 8d6a1ea6ec Merge branch 'refactor-anyhow-arti-crate' into 'main'
Remove `anyhow` from `tor-config` crate

See merge request tpo/core/arti!707
2022-08-31 13:14:46 +00:00
Nick Mathewson f2699cb715 Run cargo update in preparation for release. 2022-08-30 20:09:19 -04:00
Nick Mathewson db50d57880 Upgrade serial_test in preparation for release. 2022-08-30 20:09:19 -04:00
Nick Mathewson 79860041fe Upgrade statrs in preparation for release. 2022-08-30 20:09:19 -04:00
Arturo Marquez 7d3d24cddf
Remove `anyhow` from `tor-config` crate 2022-08-28 18:07:53 -05:00
Nick Mathewson 2c4a176e66 Add functionality to listen for SIGHUPs. 2022-08-26 15:33:56 -04:00
Ian Jackson 56fd5ac779 Merge branch 'safelog_more' into 'main'
Apply safelog to more of the things that we log

See merge request tpo/core/arti!693
2022-08-26 13:20:00 +00:00
Ian Jackson 12476bf0d4 arti: cfg: Rename `*_port` to `*_listen` and change the type
This commit largely follows the example for resolve_alternative_specs.

The difference is that there are two fields, so we use a macro to
avoid recapitulating the field names.
2022-08-25 18:41:28 +01:00
Ian Jackson f588268128 tor-config: Provide misc::Listen 2022-08-25 18:40:14 +01:00
Ian Jackson 2fa75be660 tor-basic-utils: Provide IoErrorExt is_not_a_directory()
We're going to want this functionality, which isn't in the stable
stdlib.
2022-08-25 15:58:29 +01:00
Nick Mathewson 920f7a3f53 tor-chanmgr: don't log addresses so much.
We now log connection attempts at debug!, and mark relay target
addresses as sensitive.
2022-08-25 10:54:50 -04:00
Nick Mathewson a8b3e147fe arti_client: Refuse to build a client if we are setuid.
Arti is not designed to be a setuid-safe program.

Part of #523.
2022-08-24 15:23:24 -04:00
Ian Jackson 14c6e17797 tor-cell: PaddingNegotiate::start: take IntegerMilliseconds 2022-08-17 10:54:41 +01:00
Ian Jackson 18a6234101 channel padding: Test through most of the layers 2022-08-17 10:54:41 +01:00
Ian Jackson 50ca64218e channel padding: Send negotiation cells 2022-08-16 18:43:23 +01:00
Ian Jackson 76a1c45202 Introduce ChannelConfig
This commit is just the necessary plumbing.  The config is currently
empty.  We'll add something to it, for padding control, later.
2022-08-16 18:39:57 +01:00
Ian Jackson 2fbc196f8e tor-config: Introduce PaddingLevel
This will be used for controlling channel padding, for now.
2022-08-16 18:38:53 +01:00
Ian Jackson 806828c01c tor-proto: padding::Parameters: use impl_standard_builder
This is more standard.  It also provides the ::build() method.

This isn't a config type, and build failures ought not to happen,
so we use Bug for the error.
2022-08-16 18:37:06 +01:00
Nick Mathewson 3c1bfb4916 arti: Add support for process hardening
This is a compile-time feature with an associated configuration
flag, both enabled by default.

When it's turned on, hardening prevents the arti process from
dumping core or being attached to by low-privileged processes.
(This is a defense-in-depth measure, not an absolute way to prevent
attacks.  For more information, see
[`secmem_proc`](https://docs.rs/secmem-proc/0.1.1/secmem_proc/).)

Closes #364.
2022-08-15 12:59:56 -04:00
Nick Mathewson e74612456f Merge branch 'less_arti_surface' into 'main'
Reduce the arti crate's API surface; improve semver documentation.

Closes #522, #530, and #532

See merge request tpo/core/arti!664
2022-08-11 20:09:53 +00:00
Nick Mathewson f548a6ac55 arti: Move most public APIs behind `experimental-api`.
The remaining unconditionally public APIs are those related to our
configuration objects, and the main_main() API.

The rationale for making main_main() public is to have an actual
entry point.

The rationale for making the config APIs public is:

  1. We really do intend for others to be able to read our
     configuration files using this API.
  2. The structure of our configuration files is already part of our
     interface.

Closes #530.
2022-08-11 15:35:32 -04:00
eta 0775b6d42d tor-congestion: implement the RTT estimation algorithm from prop#324
This commit implements the round-trip-time estimation algorithm from Tor
proposal 324, validating the implementation against the test vectors
found in C tor. (Note that at the time of writing, the new test vectors
may not be committed to C tor yet, but they will be soon.)

This also adds the necessary consensus parameters to `NetParameters`.
Some of them have been renamed in order to (hopefully) make them more
understandable.
2022-08-11 15:33:50 +01:00
Nick Mathewson 36a28a8587 Merge branch 'main' into 'linkspec_refactor_v3'
# Conflicts:
#   crates/tor-netdir/semver.md
2022-08-10 14:48:57 +00:00