Commit Graph

622 Commits

Author SHA1 Message Date
Ian Jackson 4ddbb3daeb connection preferences: Provide `set_connect_prefs` method 2022-01-19 17:45:59 +00:00
Ian Jackson dec0e1e756 connection preferences: Take ConnectPrefs by reference
This may save quite a bit of copying.  The callees don't need to copy
the whole struct; they copy the bits they need.
2022-01-19 17:42:43 +00:00
Ian Jackson 1437f953b6 connection preferences: Rename variable and docs to not say "flags"
These aren't flags.  Eg, there's an isolation token in there.
2022-01-19 17:39:29 +00:00
Ian Jackson e84ff24d11 isolation: Document orthogonality of isolated_client and isolation_group 2022-01-19 17:39:29 +00:00
Ian Jackson c433899948 clippy: Rename a `from_foo` method that doesn't do conversion 2022-01-19 17:26:09 +00:00
Ian Jackson 1d5a480f79 Fix two bugs related to incomplete read/write
Discovered by clippy
2022-01-19 17:17:56 +00:00
Ian Jackson 5e16a52e1c clippy: Suppress a warning 2022-01-19 17:12:26 +00:00
Nick Mathewson db2ca6ebc4 Merge branch 'bootstrap_reporting' 2022-01-19 08:40:36 -05:00
eta ca35873654 Merge branch 'eta/292-2' into 'main'
arti-bench: add concurrency, write benchmark results out to JSON

See merge request tpo/core/arti!243
2022-01-19 13:28:23 +00:00
Nick Mathewson d1c362f308 bootstrap reporting: Documentation fixups from review. 2022-01-19 08:22:42 -05:00
eta a768e7fd8f Merge branch 'correct-cache' into 'main'
Put our cache files in the right place.

Closes #297

See merge request tpo/core/arti!244
2022-01-19 12:56:49 +00:00
Nick Mathewson 79e6dc1d4b Put our cache files in the right place.
This resolves a copy-and-paste error where we were putting
everything in our state directory.

Closes #297.
2022-01-18 13:32:06 -05:00
Nick Mathewson 41e3498f8a Integrate status information at arti-client
This commit combines status update information from tor-dirmgr and
tor-chanmgr in the arti-client crate, so that the user can get to
it; it represents a high-level view of the client's ability to reach
the network and route traffic.

I have omitted the tor-circmgr support for now; it's mostly not
needed.

At present it's not so useful, since there's no way for a client to
get a TorClient that _isn't_ completely bootstrapped, and therefore
there's no way to actually watch these events until they're no
longer interesting.  That should change with arti#293.

This is part of #96.
2022-01-18 13:27:56 -05:00
Nick Mathewson c162e57e29 tor-chanmgr: Add bootstrap/status reporting.
The information is pretty basic here: we use "have we been able to
connect/TLS-handshake/Tor-handshake" as a proxy for "are we on the
internet? Are we on a reasonably unfiltered part of the internet?"

Eventually we'll want to make the information gathered and exported
more detailed: I've noted a few places in the code.  For now,
however, this is about as good as C Tor does today, and it should be
a good starting point.

This uses a slightly different design from tor-dirmgr.  Instead of
exporting an entire state structure via `postage::watch`, it exports
only the parts of that structure which the user is supposed to
read.  I think that's more reasonable in this case because most of
the possible internal transitions in the tor-chanmgr state don't
cause a change in the exposed status.
2022-01-18 13:06:08 -05:00
Nick Mathewson f34faec7d9 tor-dirmgr: Create a bootstrap-status exporting mechanism.
The interface is similar to the one exposed by `arti-client`: it
internally uses postage::watch to give a series of events showing
when a bootstrap status is changing.

Thanks to the existing state/driver separation in the DirMgr design
we don't need much new logic: each download state needs to expose
(internally) how far along it is in its download, which the
bootstrap code passes to the DirMgr if it has changed.

I believe that in the long run, we'll probably want to expose more
(or different) information here, and we'll want to process it
differently.  With that in mind, I've made the API for
`DirBootstrapStatus` deliberately narrow, so that we can change its
of its internal later on without breaking code that depends on it.

(The information exposed by this commit is not yet summarized in
`arti-client`.)

Part of #96.
2022-01-18 13:06:08 -05:00
eta 2aeac45f49 arti-bench: add concurrency, write benchmark results out to JSON
We now conduct benchmark tests with multiple concurrent streams (by
default; this is configurable by passing `-p` to `arti-bench`).
Currently, these results just get "flattened" for the purposes of
statistical analysis (as in, results_raw contains the results of each
connection's timing summary, across all benchmark runs). This might be
something we wish to change in future.

The stats summary now also records "best" and "worst" values for each
metric, to give a rough idea of the range of values encountered.

Additionally, we now support writing the benchmark results out to a JSON
file. A future commit may integrate this with CI, so that we have
benchmark results for every commit as a build artefact.

(some documentation was also fixed)

part of arti#292
2022-01-18 13:46:36 +00:00
eta 51ddac646b Merge branch 'eta/292-1' into 'main'
arti-bench: add support for multiple samples & averaging

See merge request tpo/core/arti!240
2022-01-14 15:18:58 +00:00
eta 82beb52fca arti-bench: add support for multiple samples & averaging
We now do multiple samples (configurable; default 3) per type of
`arti-bench` benchmark run, and take a mean and median average of all
data collected, in order to hopefully be a bit more resilient to random
outliers / variation.

This uses some `futures::stream::Stream` hacks, which might result in
more connections being made than required (and might impact the TTFB
metrics somewhat, at least for downloading).

Results now get collected into a `BenchmarkResults` struct per type of
benchmark, which will be in turn placed into a `BenchmarkSummary` in a
later commit; this will also add the ability to serialize the latter
struct out to disk, for future reference.

part of arti#292
2022-01-14 15:00:11 +00:00
Nick Mathewson ae9bea5d94 Merge branch 'bootstrap_reporting_api' into 'main'
Implement the basics of a bootstrap-status API.

See merge request tpo/core/arti!237
2022-01-13 15:42:50 +00:00
Nick Mathewson 1bd2790d51 Implement the basics of a bootstrap-status API.
The purpose of a this API is to tell the user how far along Arti is
in getting bootstrapped, and if it's stuck, what it's stuck on.

This API doesn't yet expose any useful information: by the time it's
observable to a client, it's always "100% bootstrapped."  But I'm
putting it in a MR now so that we can review the basic idea, and to
avoid conflicts with later work on tickets like #293 and #278.

This is part of #96.
2022-01-13 10:29:49 -05:00
daniel.eades 1ecf383e8f refactor `arti-bench` 2022-01-13 14:16:01 +00:00
eta c003fde04d Merge branch 'channel-arc-rework-5' into 'main'
chanmgr: get rid of Arc around Channel

See merge request tpo/core/arti!236
2022-01-13 13:12:30 +00:00
Ian Jackson 9b723cba53 chanmgr: get rid of Arc around Channel 2022-01-13 13:12:29 +00:00
Nick Mathewson bbf7c59b2d Describe when we will need SendmeAcceptMinVersion
(spoiler: not until we have a relay implementation)

Closes #53.
2022-01-12 15:52:24 -05:00
Nick Mathewson e335f6c75a Change RequireSendmeAuth to an enum.
This is a fine example of why booleans are risky:
it's far to easy to pass "animate:bool" into "inanimate:bool" like
we did here.

This is a followup from our fix to #294.
2022-01-12 15:46:36 -05:00
Nick Mathewson 1e915c3946 Fix a boolean inversion in auth_sendme_optional.
Previously we were requiring authenticated sendme cells exactly when we
should be permitting the old format, and vice versa.

This bug was caused by using a boolean to represent one property, but
with giving that boolean two different senses without inverting at the
right time.

The next commit will prevent a recurrence.

Closes #294
2022-01-12 15:36:55 -05:00
Nick Mathewson d49a490d4a Document SendmeEmitMinVersion status
(We don't need to look at SendmeEmitMinVersion since higher
values are not yet defined.)
2022-01-12 15:13:19 -05:00
Nick Mathewson e0ee3b5049 Explain that CfgPath can look at the environment.
Closes #246.
2022-01-12 14:59:13 -05:00
Nick Mathewson b4761f8cfd Merge branch 'eta/182' into 'main'
Improve the layout of crate exports; add runtime convenience functions

See merge request tpo/core/arti!235
2022-01-11 18:42:15 +00:00
Ian Jackson cfcd3ea689 Add a blank line between doc and comment. 2022-01-11 18:23:58 +00:00
Nick Mathewson 08d3ed978f Merge branch 'ticket_176_v2' into 'main'
guardmgr: Use a better persistent data format

Closes #176

See merge request tpo/core/arti!233
2022-01-11 17:52:00 +00:00
Nick Mathewson b89ce48490 Remove now-unused GuardSet::new(). 2022-01-11 12:00:09 -05:00
Nick Mathewson 70a2e2e751 guardmgr: Use a better persistent data format
Previously we stored only one guard sample, in a state file called
"default_guards".  That's not future-proof, since we want to have
multiple samples in the future.  (`guard-spec.txt` specifies
separate samples for highly restrictive filters, and for bridge
usage.)

This patch changes our behavior so that we can store multiple
samples in a new "guards" file.

I had thought about automatically migrating from the previous file
format and location, but I don't think that's necessary given our
current (lack of) stability guarantees.

Closes #176.
2022-01-11 12:00:09 -05:00
Nick Mathewson f89b0bc752 guardmgr::..::sample_test: Fix intermittent failure.
This test should only fail very rarely (around 1/2.4e8) when guards
are chosen from a list of 20 with uniform probability.  But that
wasn't what we were doing on the mock test network: we were choosing
from a list of 10 viable guards, with nonuniform probability.

As a fix, we change the test network probabilities so that the
guards _are_ chosen with a uniform probability for this test, and we
use a modified version of the test network where there are indeed 20
Guard-flagged relays with the required DirCache=2 protocol.

Closes #276.
2022-01-11 11:35:16 -05:00
eta 41e202a3a4 Improve the layout of crate exports; add runtime convenience functions
This commit addresses multiple problems highlighted by arti#182:

- `arti-client` had some types in its public API that weren't accessible
  without importing another crate (`CfgPath`, `DataReader`,
  `DataWriter`). This has been fixed.
  - In addition, the doc comments for `DataReader` and `DataWriter` were
    cleaned up to be of better quality, now that they're public.
- It was impossible to use `arti-client` without also importing
  `tor-rtcompat`. This is now fixed by the addition of two convenience
  methods: `TorClient::bootstrap_with_tokio` and
  `TorClient::bootstrap_with_async_std`.
- Potentially controversially: `tor-rtcompat` now returns *concrete*
  types from methods like `current_runtime`, instead of `impl Runtime`.
  - This was needed in order to actually be able to name the `TorClient`
    type that results from using these methods.
  - This does mean we lose API flexibility, but on balance I think this
    is a good thing, because the API we *do* have is actually usable...
2022-01-11 15:16:03 +00:00
Nick Mathewson 7d3482ca1a Bump all crate versions to 0.0.3. 2022-01-11 09:40:32 -05:00
Nick Mathewson c5f50b7d41 Update README.md files (automated) 2022-01-11 09:37:45 -05:00
Ian Jackson 821091ae95 Apply suggestions to better describe the purpose of LogGuards. 2022-01-10 13:23:11 -05:00
Nick Mathewson 1a16f5a7d6 Tracing configuration for logfiles, per-target filters
Previously we could only configure one global tracing filter that
applied to stdout and journald.  There was no support for log files,
either.

This patch fixes both issues, by substantially revising the
configuration format: There are now separate filters for each log
file, for journald, and for the console log.  Because we want to
allow multiple logfiles, they have to go into an array in the
configuration.

The configuration logic has grown a bit complicated in its types,
since the tracing_subscriber crate would prefer to have the complete
structure of tracing Layers known statically. That's fine when you
know how many you have, and which kinds there will be, but for
the runtime-configuration case we need to mess around with
`Box<dyn Layer ...>`.

I also had to switch from tracing_subscriber's EnvFilter to its
Targets filter.  It seems "EnvFilter" can only be applied as a Layer
in itself, and won't work as a Filter on an individual Layer.

Closes #166.

Closes #170.
2022-01-10 13:23:11 -05:00
Nick Mathewson 736763fb51 Move tracing setup into a separate module.
No code changes here yet.
2022-01-10 13:17:02 -05:00
eta de1b19c22a Fixup broken doc comment from arti!220
That's what I get for blindly trusting @nickm :p
2022-01-10 15:10:41 +00:00
eta c42fac09a5 Merge branch 'ticket_281' into 'main'
Expose and rename stream timeout config.

Closes #281

See merge request tpo/core/arti!231
2022-01-10 15:05:31 +00:00
Nick Mathewson 01c851ad46 Expose and rename stream timeout config.
Previously we kept this in an ambiguously named type,
`ClientTimeoutConfig`. But everything we do right now is client
related! So `StreamTimeoutConfig` is a better name.

Also, we'd previously neglected to expose the builder for this type
from `TorClientConfigBuilder`. Now we do.

Closes #281.
2022-01-10 09:46:43 -05:00
Nick Mathewson 7819dd7bac Make the arti_client::Result type public.
Closes #280.
2022-01-10 09:33:26 -05:00
eta da848a1b9c Merge branch 'ticket_178' into 'main'
Fix ticket 178: Don't use a NetDir until we have microdescriptors for all of our primary guards.

Closes #178

See merge request tpo/core/arti!220
2022-01-10 14:02:24 +00:00
eta 4b1a3976cb Merge branch 'bug274' into 'main'
Fix busy-loop when consensus is near expiring.

Closes #274

See merge request tpo/core/arti!223
2022-01-10 13:47:52 +00:00
eta e6e65d6574 Merge branch 'minimize_deps' into 'main'
Minimize the required version for each dependency.

Closes #275

See merge request tpo/core/arti!228
2022-01-10 13:44:53 +00:00
Neel Chauhan 439b8b3e64 Use *_with_prefs() for Option<ConnectPrefs> callers in TorClient::connect 2022-01-08 13:36:49 -08:00
Nick Mathewson 4841b50c9f Minimize the required version for each dependency.
I found these versions empirically, by using the following process:

First, I used `cargo tree --depth 1 --kind all` to get a list of
every immediate dependency we had.

Then, I used `cargo upgrade --workspace package@version` to change
each dependency to the earliest version with which (in theory) the
current version is semver-compatible.  IOW, if the current version
was 3.2.3, I picked "3".  If the current version was 0.12.8, I
picked "0.12".

Then, I used `cargo +nightly upgrade -Z minimal-versions` to
downgrade Cargo.lock to the minimal listed version for each
dependency.  (I had to override a few packages; see .gitlab-ci.yml
for details).

Finally, I repeatedly increased the version of each of our
dependencies until our code compiled and the tests passed.  Here's
what I found that we need:

anyhow >= 1.0.5: Earlier versions break our hyper example.

async-broadcast >= 0.3.2: Earlier versions fail our tests.

async-compression 0.3.5: Earlier versions handled futures and tokio
    differently.

async-trait >= 0.1.2: Earlier versions are too buggy to compile our
    code.

clap 2.33.0: For Arg::default_value_os().

coarsetime >= 0.1.20: exposed as_ticks() function.

curve25519-dalek >= 3.2: For is_identity().

generic-array 0.14.3: Earlier versions don't implement
    From<&[T; 32]>

httparse >= 1.2: Earlier versions didn't implement Error.

itertools at 0.10.1: For at_most_once.

rusqlite >= 0.26.3: for backward compatibility with older rustc.

serde 1.0.103: Older versions break our code.

serde_json >= 1.0.50: Since we need its Value type to implement Eq.

shellexpand >= 2.1: To avoid a broken dirs crate version.

tokio >= 1.4: For Handle::block_on().

tracing >= 0.1.18: Previously, tracing_core and tracing had separate
    LevelFilter types.

typenum >= 1.12: Compatibility with rust-crypto crates

x25519-dalek >= 1.2.0: For was_contributory().

Closes #275.
2022-01-07 19:08:58 -05:00
Nick Mathewson e9a507af67 Merge branch 'circ_self_by_ref' 2022-01-07 14:48:21 -05:00
Nick Mathewson c123138f74 Merge branch 'remove-type-annotation' into 'main'
tor-circmgr: Remove a type annotation in a method call

See merge request tpo/core/arti!225
2022-01-07 19:33:04 +00:00
Nick Mathewson 0151ceceb0 ClientCirc: change some methods to take &self
Previously they took Arc<Self>, and then Self, but &self is perfectly
fine here.
2022-01-07 13:55:26 -05:00
Nick Mathewson debac8b973 circmgr: Fix a pair of clippy warnings. 2022-01-07 13:53:21 -05:00
Ian Jackson d63a251afc tor-circmgr: Remove Arc around ClientCirc
See the new commentary text on `ClientCirc` for the rationale.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2022-01-07 18:19:20 +00:00
Ian Jackson 14d7edc5f8 tor-circmgr: tests: Do fake circuit equality by id
We are going to get rid of the Arc.  Happily there is an id which is
always constructed uniquely and preserved by clone.

(auto-deref lets us make the function take &Self instead of &Arc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2022-01-07 18:16:43 +00:00
Ian Jackson 7c55141e3f tor-circmgr: tests: Introduce and use FakeCirc::eq()
This removes a lot of open-coded Arc::ptr_eq() calls

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2022-01-07 18:16:43 +00:00
Ian Jackson a034ef3526 tor-circmgr: Replace some Arc::clone with .clone()
This will make the code work when it's not an Arc any more.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2022-01-07 18:16:39 +00:00
Nick Mathewson d9b423c17f Fix busy-loop when consensus is near expiring.
When our current consensus is getting close to being invalid (but
it isn't invalid yet), we try to get a new one. So far, so good.

But we had a bug: when we went to get a new consensus, we'd see that we
had a perfectly fine not-yet-invalid consensus in our cache, reload it,
find that it was ready, and continue!

This patch fixes our behavior: If we have a usable consensus, then
when we reset the bootstrapping process, we ignore any cached consensus.

Fixes bug #274.
2022-01-07 13:16:06 -05:00
Ian Jackson 5469579ca9 tor-circmgr: Remove a type annotation in a method call
This is a method, so the resolution is automatic.  It's not clear to
me why this was written out this way, given that extend_ntor is right
above.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2022-01-07 18:12:27 +00:00
Ian Jackson 19a104e2cc tor-circmgr: Require that AbstractCirc are Clone
We are going to get rid of a lot of Arc, so we need the underlying
thing to be Clone.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2022-01-07 18:12:15 +00:00
Nick Mathewson e8e0f67336 Only replace netdir once we have enough guard MDs.
This prevents a security-failure condition that could happen if our
directory caches don't give us these microdescriptors, but we
nevertheless decide that the directory is usable.

Closes #178
2022-01-06 15:58:43 -05:00
Nick Mathewson 723894b9ea Tests for new guardmgr functionality. 2022-01-06 15:58:36 -05:00
Nick Mathewson 5ac0fcb7ef Add API to check if primary MDs are missing.
We need this information to know if it's okay to migrate to a new
NetDir, or if we need to download more information first.

Part of #178.
2022-01-06 15:58:23 -05:00
Neel Chauhan 5dfedb4c6f De-Arc-ify Buildable for ClientCirc 2022-01-06 12:22:49 -08:00
eta f08854bc69 Merge branch 'main' into 'remove_unused_rngs'
# Conflicts:
#   crates/tor-circmgr/src/build.rs
2022-01-06 15:48:42 +00:00
eta ea41fa3346 Merge branch 'refactor/unwrap-or-default' into 'main'
prefer 'unwrap_or_default' to manual constructor

See merge request tpo/core/arti!215
2022-01-06 15:36:12 +00:00
Nick Mathewson db65fdd04e guardmgr: Don't use no-md guards for data circs.
If we don't know a current microdescriptor for a guard, we can't use it
for multihop circuits, since we don't know its onion keys.

This is part of a fix for #178.
2022-01-06 09:52:21 -05:00
Nick Mathewson 214ac17eed Move a comment to the right place. 2022-01-06 09:05:08 -05:00
Nick Mathewson 5c3300867d Merge remote-tracking branch 'origin/mr/214' 2022-01-06 09:02:09 -05:00
Nick Mathewson 3a456100a8 Merge remote-tracking branch 'origin/mr/217' 2022-01-06 08:30:25 -05:00
Nick Mathewson c15168be61 Merge remote-tracking branch 'origin/mr/212' 2022-01-06 08:28:13 -05:00
Ian Jackson 1e70d56737 arti-bench: Remove a FIXME by saying it's OK for this program to panic 2022-01-06 11:58:01 +00:00
Daniel Eades d68e934716 prefer 'unwrap_or_default' to manual constructor 2022-01-01 19:14:29 +00:00
Daniel Eades 592642a9e6 extend lints to include 'clippy::all' 2021-12-28 20:15:40 +00:00
Neel Chauhan d72d37ff4a Remove a bunch of unused RNGs 2021-12-25 18:44:55 -08:00
Neel Chauhan 383843f0d7 tor-circmgr: Don't clone parameters in create_chantarget() 2021-12-25 17:22:38 -08:00
Neel Chauhan 7dba3d8c51 tor-proto: In begin_stream_impl(), if number of hops is zero, don't continue 2021-12-25 16:01:22 -08:00
Nick Mathewson efe74e8c9b Only count timeouts when we've seen net activity.
This closes arti#256.  It makes our behavior match Tor's more closely,
though it has a simpler implementation than Tor. I think that the extra
complexity in Tor's logic is because we used to record timeouts in
the histogram as well as in the success/failure log.
2021-12-20 15:34:17 -05:00
Nick Mathewson 09d0c20c94 Merge branch 'eta/instant-checked-add' into 'main'
preemptive.rs: Use Instant::checked_add instead of raw subtraction

See merge request tpo/core/arti!206
2021-12-20 20:07:59 +00:00
eta 091065454e preemptive.rs: Use Instant::checked_add instead of raw subtraction
The implementations of `Add` / `Sub` (et al.) on `std::time::Instant`
can panic if the underlying OS structure can't represent the result
(like arti#266). Use Instant::checked_add and print a warning instead,
to prevent panicking.

Also, we now add instead of subtracting; I suspect it's reasonable that
you might not be able to go backward past the first `Instant` created on
some platforms, but going *forward* should probably work?
2021-12-20 19:27:55 +00:00
eta 0cdf65c256 Merge branch 'refactor/must-use-self' into 'main'
address clippy's latest lint

See merge request tpo/core/arti!205
2021-12-20 18:38:18 +00:00
Nick Mathewson 6303a71d58 tor-proto: Replace XXXs with references to arti#269
These will require thought; should we ignore them, act on them, or
continue to  treat them as internal errors?
2021-12-20 10:56:24 -05:00
Nick Mathewson 26fc8073f2 Remove XXXs from tor-circmgr::mgr
IIUC, these anticipatd a need to store min_exit_circs_per_port in
CircMgr.  But the current design, where it goes into preemptive.rs and
thence to usage, seems to work fine.
2021-12-20 10:46:13 -05:00
Nick Mathewson f73f6a4e80 arti-client: Change an XXXX to a TODO.
We _do_ reject bad hostnames: just not where I once thought we might.
We need to decide if the current behavior is what we want (and I think
it is, probably?).
2021-12-20 10:02:24 -05:00
Nick Mathewson a2afb29806 Change an UTF-8 XXX to a TODO.
We're assuming that prop285 is accepted in some form.
2021-12-20 09:54:41 -05:00
Nick Mathewson 8cf143217e tor-netdoc: Change an XXX to a TODO.
Our behavior in handling not-yet-valid router descriptors doesn't match
the C Tor implementation, but it's not a big deal:
we don't currently use router descriptors at all.
2021-12-20 09:46:56 -05:00
Nick Mathewson 6299ca70b4 tor-netdoc: Use a more correct error type
If we fail to convert a curve25519 key to an ed25519 key for checking
the onion-key crosscert, don't call that an internal error: it means
that something is wrong with the provided ntor key.
2021-12-20 08:58:30 -05:00
Nick Mathewson 92e53bff62 Remove an XXXX about ed25519 signatures.
As of tor-spec commit 01122c5bd7d2f0f, the spec is no longer ambiguous
on this point.
2021-12-20 08:53:42 -05:00
Daniel Eades 9b51a52b53 address clippy's latest lint 2021-12-20 09:46:41 +00:00
eta 0577eac0bf Merge branch 'one_metahandler_at_a_time' into 'main'
tor-proto: Allow one meta-cell handler at a time.

See merge request tpo/core/arti!204
2021-12-16 21:43:33 +00:00
Nick Mathewson 64257a10fa tor-proto: Allow one meta-cell handler at a time.
Previously the code would let us try to install a meta-cell handler
before the old one was done, leading to possible confusion.
2021-12-16 16:01:50 -05:00
eta b01f695f53 Merge branch 'arti-bench' into 'main'
Introduce an experimental benchmarking utility for Arti

See merge request tpo/core/arti!195
2021-12-16 20:47:47 +00:00
eta 7921a88f8d Merge branch 'fallbackdirs-15-12-2021' into 'main'
fallbackdir: Update list generated on December 15, 2021

See merge request tpo/core/arti!202
2021-12-16 20:30:16 +00:00
eta 6a12f388f2 Merge branch 'ct_sendme_tags' into 'main'
tor-proto: use const-time eq on sendme tags.

See merge request tpo/core/arti!201
2021-12-16 20:29:01 +00:00
Tor CI Release e17359bc18 fallbackdir: Update list generated on December 15, 2021
Signed-off-by: Tor CI Release <no-email@torproject.org>
2021-12-16 11:52:22 -05:00
Nick Mathewson 51c4ca73f2 tor-proto: set HalfStream::connected_ok right.
Previously we'd always set it to true, allowing one CONNECTED per
half-closed stream even if the stream had already received a
CONNECTED  cell.

This resolves an XXXX.
2021-12-16 11:48:39 -05:00
Nick Mathewson a09fbc9f27 tor-proto: replace a streammap XXXX with a ticket. 2021-12-16 11:33:50 -05:00
eta 06a94288ca Introduce an experimental benchmarking utility for Arti
The new `arti-bench` crate does a simple end-to-end benchmark test
embedding Arti: it generates some random data (of configurable amount,
depending on command-line parameters), and then sends said data back and
forth via Arti (which should be configured to use a local Chutney
network).

Additionally, the benchmark can also be run via a local SOCKS5 server
(in order to benchmark the performance via a local Chutney node, for
comparison).

The `tests/chutney/arti-bench.sh` sets up and tears down Chutney as
required to make this work.

This is very much a first cut; there are many things that should
eventually get added, such as support for multiple connections, JSON
output capabilities, running multiple tests, ...
2021-12-16 16:12:59 +00:00
Nick Mathewson d794355b07 tor-proto: use const-time eq on sendme tags.
There's no known attack here, but it's best practice to always compare
digests using a constant-time comparison operator.

This resolves an XXXX comment.
2021-12-16 11:06:30 -05:00
Nick Mathewson e2dd418c84 tor-proto: document an infelicitous behavior.
This was an XXXX before. Now it explains why the behavior is safe for
now, but maybe not forever.
2021-12-16 10:39:00 -05:00