Commit Graph

2255 Commits

Author SHA1 Message Date
Ian Jackson 427e07ec8a Merge branch 'bug299' into 'main'
Make max_file_limit configurable

Closes #299

See merge request tpo/core/arti!261
2022-01-28 11:17:49 +00:00
Neel Chauhan 417809123c Make max_file_limit configurable 2022-01-28 11:17:49 +00:00
eta 54bdab588a Merge branch 'improve-coverage-ci-job' into 'main'
Improve `coverage` job in CI

See merge request tpo/core/arti!269
2022-01-28 00:28:07 +00:00
arturomf94 72a08cc295 Improve `coverage` job in CI 2022-01-28 00:28:06 +00:00
Nick Mathewson c5fa23b336 Merge branch 'dirmgr_state_test_fix' into 'main'
Fix test failure in tor_dirmgr::state::test::get_microdescs_state

See merge request tpo/core/arti!268
2022-01-27 22:36:31 +00:00
Nick Mathewson 98d8171610 Fix test failure in tor_dirmgr::state::test::get_microdescs_state
This failure occurred because our tests use canned data to exercise
the directory state functionality, and the canned consensus has
suddenly become very expired.

There are better fixes possible, but this is a minimal one that
should get CI working on main again.
2022-01-27 17:13:38 -05:00
eta c9feb3803b Merge branch 'shellcheck_teardown' into 'main'
Fix/suppress shellcheck errors in teardown.sh

See merge request tpo/core/arti!266
2022-01-27 21:32:59 +00:00
Nick Mathewson bc867fed65 Merge branch 'rtcompat_tests' into 'main'
Unit test cleanup in tor-rtcompat

See merge request tpo/core/arti!267
2022-01-27 21:25:53 +00:00
Nick Mathewson 19f878b3aa tor-rtcompat: remove some unused code.
Nothing actually used these accessor functions, and it's not clear
what would.  We can add them later if they're needed.
2022-01-27 15:52:59 -05:00
Nick Mathewson f7373f8b20 tor-rtcompat: Add some miscellaneous tests
These probably aren't for things that will fail IRL, but it's nice
to have coverage on the code, just in case.
2022-01-27 15:48:30 -05:00
Nick Mathewson af85262257 tor-rtcompat: Simplify test-declaration macros.
Now there's much less copy-and-paste.
2022-01-27 15:09:09 -05:00
Nick Mathewson 9435e4b36e Move tor-rtcompat tests to lib.rs
This makes our layout more similar to our other crates, and
successfully informs our grcov exclusion pattern that these tests
are indeed tests.

Doing this knocks down the reported coverage for the tor-rtcompat
crate, but that's okay: we hadn't earned it.

I hereby promise that this commit is only code-movement.
2022-01-27 14:45:00 -05:00
Nick Mathewson 83a01725d7 Fix/suppress shellcheck errors in teardown.sh
Rationale: It's good to have all of our scripts pass shellcheck.
2022-01-27 14:24:12 -05:00
Nick Mathewson 1c620019c4 Merge branch 'eta/303' into 'main'
doc/Release.md: add note to check feature combinations

See merge request tpo/core/arti!265
2022-01-27 18:33:43 +00:00
Nick Mathewson aa9e5515d8 with_coverage: resolve a shellcheck warning
Shellcheck doesn't like it when you do `rm -r "$A/$B"` : it worries
that the path might accidentally expand to /.

That shouldn't actually be possible in this case, but let's avoid
being the people who accidentally remove somebody's filesystem.
2022-01-27 12:19:35 -05:00
Nick Mathewson 5b6b0d6a7d Once more exclude arti-bench from coverage.
This was added in !210; looks like it got removed by mistake with
!221.
2022-01-27 12:14:32 -05:00
Nick Mathewson 40c67e5e20 with_coverage.sh: split grcov options into separate lines.
This makes it easier to see when they're changing, and will make
future patches easier to review.
2022-01-27 12:09:20 -05:00
eta ecb63bafa5 doc/Release.md: add note to check feature combinations
This is a nice reminder to have before we solve arti#303 for good.
2022-01-27 15:53:46 +00:00
eta 2f39dbd587 Merge branch 'rtcompat-refactor' into 'main'
Refactor the tor-rtcompat API.

Closes #301 and #300

See merge request tpo/core/arti!263
2022-01-27 15:53:35 +00:00
Nick Mathewson 9f3ad85d75 Document why {current,create}_runtime are type-erased 2022-01-27 10:31:45 -05:00
eta c4321289f2 Apply @eta's suggestions from review on !263
Comment-only.
2022-01-27 15:25:57 +00:00
eta 785ad605d7 Merge branch 'coverage-tracking' into 'main'
Add test coverage tracking with CI/CD

Closes #250

See merge request tpo/core/arti!221
2022-01-27 12:56:22 +00:00
Arturo Marquez 899691e5c7
Install bs4 in coverage job 2022-01-26 23:48:11 -06:00
Arturo Marquez b3ba32824e
Use `maint/with_coverage.sh` in coverage job 2022-01-26 23:13:15 -06:00
Arturo Marquez 3213b89390
Add changes in `maint`
Follows up on changes from https://gitlab.torproject.org/trinity-1686a/arti/-/merge_requests/2/diffs#bc2cc73a8917fa6fed183148df69119665eb4e55
2022-01-26 22:46:45 -06:00
Nick Mathewson 474a46999d CI: Fix async-std task
Previously it didn't enable any TLS provider, since we made
native-tls optional a few commits ago.  Now it enables rustls,
so that rustls also gets a quick check along with async-std.

I've also switched this test to use "cargo clippy" in place of
"cargo test" because it's a strict superset.
2022-01-26 15:12:39 -05:00
Nick Mathewson 5dcc821146 Fix documentation references for tor-rtcompat refactoring. 2022-01-26 14:58:28 -05:00
Nick Mathewson 9c043a648a arti: be more careful to use the user-selected runtime 2022-01-26 14:31:49 -05:00
Nick Mathewson bf8fa66d36 Rename `SpawnBlocking` trait to `BlockOn`.
This avoids a future confusion with the new `SpawnBlocking` trait in
async_executors v0.5, and better describes what the trait provides.
2022-01-26 14:06:58 -05:00
Nick Mathewson dec2c4ee63 Make test_with_all_runtimes cover _all_ the runtimes.
This took some refactoring, so that I wouldn't need to define 9
different versions of the function.  It also required that we change
the behavior of test_with_all_runtimes slightly, so that it asserts
on _any_ failure rather than asserting on most but returning Err()
for others.  That in turn required changes to a few of its callers.

There's probably a better way to do all of this macro business, but
this is the best I could find.
2022-01-26 14:06:58 -05:00
Nick Mathewson 30b3818a9e Make the native-tls crate optional.
This commit puts the native-tls crate behind a feature.  The feature
is off-by-default in the tor-rtcompat crate, but can be enabled
either from arti or arti-client.

There is an included script that I used to test that tor-rtcompat
could build and run its tests with all subsets of its features.

Closes #300
2022-01-26 14:06:58 -05:00
Nick Mathewson 8af3528cd3 Define aliases for "the best enabled runtime".
This helps us simplify our code in a few ways, and will help even
more once native_tls is optional.
2022-01-26 14:06:58 -05:00
Nick Mathewson 6f29d485e4 Make current/create functions into runtime member functions.
This should help avoid some amount of temptation towards API
proliferation.
2022-01-26 14:06:58 -05:00
Nick Mathewson 2333d0466e Rename FooRuntime to FooNativeTlsRuntime for consistency. 2022-01-26 14:06:58 -05:00
Nick Mathewson 05a04220cc Limit the inner types in tor-rtcompat that have to implement Clone
If we implement our own clone on CompoundRuntime, we no longer need
Clone implementations on our TlsProvider implementations.
2022-01-26 14:06:58 -05:00
Nick Mathewson 99c59a8f2b Remove no-longer-needed tokio runtime helper macro 2022-01-26 14:06:58 -05:00
Nick Mathewson 668364d75d Unify TokioRuntime and TokioRuntimeHandle
Having separate types here doesn't justify the (very limited)
benefit of distinguishing between the case where we have created an
executor that we own and the case where we have a handle to an
already-running tokio executor.

Part of #301.
2022-01-26 14:06:58 -05:00
Nick Mathewson 884d614a61 Remove a now-incorrect comment in tor-proto. 2022-01-26 14:06:58 -05:00
Nick Mathewson 5af8a1bf28 Remove misspellings of "rusttls". 2022-01-26 14:05:05 -05:00
eta 4aa442de1d Merge branch 'config' into 'main'
doc/CONFIG-NOTES.md: config proposal

See merge request tpo/core/arti!248
2022-01-26 17:00:23 +00:00
Nick Mathewson e145f2b600 Merge branch 'rustls_v2' into 'main'
tor-rtcompat: Add support for a rustls backend

Closes #86

See merge request tpo/core/arti!260
2022-01-25 20:10:58 +00:00
Nick Mathewson e4e691a790 More comments on the limitations of tor-rtcompat's TLS API
Also, more comments on why these limitations are safe within the
context of Tor, but you wouldn't want to use them elsewhere.
2022-01-25 13:16:39 -05:00
Nick Mathewson 0898b485aa Comment-only: document sni_hostname more.
Previously we expected the reader to automatically know why it was
called "SNI", which really isn't fair.
2022-01-25 13:16:39 -05:00
Nick Mathewson d1d121aac6 Refactor native_tls usage into its own module
This change uses the async-native-tls crate for everything, and
deletes some duplicated code.
2022-01-25 13:16:39 -05:00
Nick Mathewson 8def5a0d89 tor-rtcompat: Add support for rustls.
This is based on @janimo's approach in !74, but diverges in a few
important ways.

1. It assumes that something like !251 will merge, so that we can
   have separate implementations for native_tls and rustls compiled
   at the same time.

2. It assumes that we can implement this for the futures::io traits
   only with no real penalty.

3. It uses the `x509-signature` crate to work around the pickiness of
   the `webpki` crate.  If webpki eventually solves their
   [bug 219](https://github.com/briansmith/webpki/issues/219), we
   can remove a lot of that workaround.

Closes #86.
2022-01-25 13:16:39 -05:00
Nick Mathewson 979cfb46d1 Add a C program to make Tor-style X509 link certificates
We should never use this for anything but making the testing
certificates we use for making sure our TLS implementation works.
2022-01-24 14:22:07 -05:00
eta b893f88c70 Merge branch 'ticket_277' into 'main'
More documentation about refining build process and getting help

Closes #277

See merge request tpo/core/arti!259
2022-01-24 14:15:00 +00:00
eta a83b8c4374 Merge branch 'error-plan' into 'main'
Error plan

See merge request tpo/core/arti!257
2022-01-24 14:11:11 +00:00
eta 146fbbaaa8 Merge branch 'ticket255' into 'main'
Refactor our Runtime implementations to allow replacement parts

Closes #255

See merge request tpo/core/arti!251
2022-01-24 14:09:51 +00:00
Ian Jackson ba591a813f Merge branch 'conn-prefs-rename' into 'main'
StreamPrefs: rename from ConnectPrefs

See merge request tpo/core/arti!256
2022-01-21 17:29:57 +00:00