summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge branch 'typos' into 'main'eta2022-02-037-7/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix typos See merge request tpo/core/arti!285
| * | | | | | Fix typosDimitris Apostolou2022-02-027-7/+7
| | |/ / / / | |/| | | |
* | | | | | Temporarily disable some clippy lints on nightlyIan Jackson2022-02-0210-1/+11
| | | | | |
* | | | | | Untangle two needless Ok(r?) into just rIan Jackson2022-02-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by clippy::needless_question_mark. Sometimes Ok(r?) is needed to do automatic error conversion. I assume the lint checks for that. Anyway, in these cases it's not needed.
* | | | | | Remove many needless borrows and slicesIan Jackson2022-02-025-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via clippy::needless_borrow. In some cases I removed needless `[..]` too. See also: needless_borrow suggestion doesn't go far enough https://github.com/rust-lang/rust-clippy/issues/8389
* | | | | | clippy: Pass simply &output to fs::writeIan Jackson2022-02-021-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | clippy::needless_borrow quibbles here, IMO correctly. Its suggestion didn't go far enough: output is a String and a &String can be passed to write as-is for identical effect.
* | | | | Merge branch 'reload-config-prep' into 'main'Ian Jackson2022-02-025-61/+108
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| | Preparatory work for auto config reload See merge request tpo/core/arti!284
| * | | Un-Arc<> TorClient in the arti crateNick Mathewson2022-02-012-8/+5
| | | | | | | | | | | | | | | | | | | | TorClient doesn't need to be wrapped in an Arc any longer, thanks to other refactoring.
| * | | arti_config: Refactor configuration sources into a structNick Mathewson2022-02-013-52/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is by no means our final API, but should represent an improvement. Here instead of having to specify a list of files and their is-this-optional status, along with a list of command-line options, we have a single structure that encapsulates all of that information. Two advantages here: - Callers no longer have to remember what the boolean means. - We can "reload" more easily, by keeping the source object around. This change also implements the correct behavior for our default configuration file in `arti::main`: if the file is absent and the user doesn't list a config file, that's no problem. But if the user lists _that very same config file, we should insist that it be present.
| * | | Expose Reconfigure enum from arti-client.Nick Mathewson2022-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | This enum is required to use `TorClient::reconfigure` correctly, and as such ought to be re-exported.
* | | | arti-bench: summarize statistics with a new `Statistic` type (#298)eta2022-02-011-49/+86
|/ / / | | | | | | | | | | | | | | | | | | | | | This implements the proposal from arti#298, making the `BenchmarkResults` type be made out of a bunch of new `Statistic` types (which summarize the mean, median, range, and standard deviation of an arbitrary value) instead of overloading `TimingSummary` for this purpose.
* / / Fix invalid path character on windowsMichael2022-01-312-2/+6
|/ /
* | Bump tor-netdir and tor-guardmgr versionsarti-v0.0.4Nick Mathewson2022-01-314-9/+9
| | | | | | | | | | | | | | | | tor-netdir needs to bump because tor-netdoc bumped, even though there were no other changes in tor-netdir. Whoops. tor-guardmgr needs to bump because it already published, with the older tor-netdir.
* | Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-3115-67/+67
| |
* | Use script to update README.md files.Nick Mathewson2022-01-283-15/+16
| |
* | Merge branch 'bug299' into 'main'Ian Jackson2022-01-285-13/+85
|\ \ | | | | | | | | | | | | | | | | | | Make max_file_limit configurable Closes #299 See merge request tpo/core/arti!261
| * | Make max_file_limit configurableNeel Chauhan2022-01-285-13/+85
| | |
* | | Fix test failure in tor_dirmgr::state::test::get_microdescs_stateNick Mathewson2022-01-271-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | tor-rtcompat: remove some unused code.Nick Mathewson2022-01-271-16/+0
| | | | | | | | | | | | | | | Nothing actually used these accessor functions, and it's not clear what would. We can add them later if they're needed.
* | | tor-rtcompat: Add some miscellaneous testsNick Mathewson2022-01-274-0/+91
| | | | | | | | | | | | | | | These probably aren't for things that will fail IRL, but it's nice to have coverage on the code, just in case.
* | | tor-rtcompat: Simplify test-declaration macros.Nick Mathewson2022-01-271-60/+35
| | | | | | | | | | | | Now there's much less copy-and-paste.
* | | Move tor-rtcompat tests to lib.rsNick Mathewson2022-01-272-311/+312
|/ / | | | | | | | | | | | | | | | | | | | | 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.
* | Document why {current,create}_runtime are type-erasedNick Mathewson2022-01-271-9/+19
| |
* | Apply @eta's suggestions from review on !263eta2022-01-272-2/+2
| | | | | | Comment-only.
* | Fix documentation references for tor-rtcompat refactoring.Nick Mathewson2022-01-263-14/+18
| |
* | arti: be more careful to use the user-selected runtimeNick Mathewson2022-01-262-5/+13
| |
* | Rename `SpawnBlocking` trait to `BlockOn`.Nick Mathewson2022-01-2611-21/+21
| | | | | | | | | | This avoids a future confusion with the new `SpawnBlocking` trait in async_executors v0.5, and better describes what the trait provides.
* | Make test_with_all_runtimes cover _all_ the runtimes.Nick Mathewson2022-01-266-84/+138
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Make the native-tls crate optional.Nick Mathewson2022-01-2621-45/+143
| | | | | | | | | | | | | | | | | | | | | | 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
* | Define aliases for "the best enabled runtime".Nick Mathewson2022-01-264-23/+45
| | | | | | | | | | This helps us simplify our code in a few ways, and will help even more once native_tls is optional.
* | Make current/create functions into runtime member functions.Nick Mathewson2022-01-269-104/+127
| | | | | | | | | | This should help avoid some amount of temptation towards API proliferation.
* | Rename FooRuntime to FooNativeTlsRuntime for consistency.Nick Mathewson2022-01-265-23/+25
| |
* | Limit the inner types in tor-rtcompat that have to implement CloneNick Mathewson2022-01-263-33/+10
| | | | | | | | | | If we implement our own clone on CompoundRuntime, we no longer need Clone implementations on our TlsProvider implementations.
* | Remove no-longer-needed tokio runtime helper macroNick Mathewson2022-01-261-27/+18
| |
* | Unify TokioRuntime and TokioRuntimeHandleNick Mathewson2022-01-264-66/+54
| | | | | | | | | | | | | | | | | | 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.
* | Remove a now-incorrect comment in tor-proto.Nick Mathewson2022-01-261-3/+0
| |
* | Remove misspellings of "rusttls".Nick Mathewson2022-01-261-2/+2
| |
* | More comments on the limitations of tor-rtcompat's TLS APINick Mathewson2022-01-252-3/+29
| | | | | | | | | | Also, more comments on why these limitations are safe within the context of Tor, but you wouldn't want to use them elsewhere.
* | Comment-only: document sni_hostname more.Nick Mathewson2022-01-251-3/+5
| | | | | | | | | | Previously we expected the reader to automatically know why it was called "SNI", which really isn't fair.
* | Refactor native_tls usage into its own moduleNick Mathewson2022-01-257-230/+130
| | | | | | | | | | This change uses the async-native-tls crate for everything, and deletes some duplicated code.
* | tor-rtcompat: Add support for rustls.Nick Mathewson2022-01-258-9/+461
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Add a C program to make Tor-style X509 link certificatesNick Mathewson2022-01-241-0/+159
| | | | | | | | | | We should never use this for anything but making the testing certificates we use for making sure our TLS implementation works.
* | Merge branch 'ticket255' into 'main'eta2022-01-249-45/+339
|\ \ | | | | | | | | | | | | | | | | | | Refactor our Runtime implementations to allow replacement parts Closes #255 See merge request tpo/core/arti!251
| * | Refactor Runtimes to use separate TLS implementations internally.Nick Mathewson2022-01-198-45/+135
| | | | | | | | | | | | | | | This will make it easier to implement them using some other TLS provider as well, without having to duplicate all of our code.
| * | Add a macro to help with opaque Runtime wrappers.Nick Mathewson2022-01-192-0/+70
| | | | | | | | | | | | | | | | | | | | | We're soon going to have our different Runtime types be built as CompoundRuntime instances. We don't want to expose that detail, though, so we'll use this macro to make them implement the right traits.
| * | Add a CompoundRuntime type for runtime construction.Nick Mathewson2022-01-192-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This type can solve two problems at once. First, it lets users replace parts of an existing runtime implementation without replacing the whole thing. For example, you can use it to override your TcpProvider implementation to solve problems like #235. Second, we can use it internally to tor-rtcompat to define Runtimes piece-by-piece. Mostly we'll use this to separate our Tls implementations from our implementations of the rest of the Runtime.
* | | Rename TorClient::set_stream_prefsIan Jackson2022-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | In line with the rest of the renaming. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/256#note_2771617
* | | StreamPrefs: Re-alphabetise imports following renameIan Jackson2022-01-211-1/+1
| | | | | | | | | | | | Placates rustfmt
* | | StreamPrefs: rename from ConnectPrefsIan Jackson2022-01-215-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The docs even say this is about stream. As @nickm writes in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/252#note_2771289 we generally call end-to-end connections that are tunneled over Tor "Streams" to distinguish them from everything else in the Tor protocols that could possibly be called a "Connection". That seems to apply here too.
* | | Merge branch 'always-isolate' into 'main'Ian Jackson2022-01-201-4/+58
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Provide isolate-all-streams function Closes #279 See merge request tpo/core/arti!252