summaryrefslogtreecommitdiff
path: root/crates/arti/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix a local-only CPU DoS bug.Nick Mathewson2023-05-231-0/+10
| | | | | | | | | | | | | | | | | | Previously, there was a bug in the way that our code used our SOCKS implementations. If the buffer used for a SOCKS handshake became full without completing the handshake, then rather than expanding the buffer or closing the connection, our code would keep trying to read into the zero-byte slice available in the full buffer forever, in a tight loop. We're classifying this as a LOW-severity issue, since it is only exploitable by pluggable transports (which are trusted) and by local applications with access to the SOCKS port. Closes #861. Fixes TROVE-2023-001. Reported-By: Jakob Lell <jakob AT srlabs DOT de>
* print both static sqlite/tls when 'static' feature is usedtrinity-1686a2023-05-081-2/+2
|
* RPC: Start on plumbing TorClient into our RPC codeNick Mathewson2023-05-042-4/+9
| | | | | Because of #837, we won't be able to work with _every_ TorClient<R>, so I'm only going to be using TorClient<PreferredRuntime> for now.
* RPC: Move the "listen" part of the RPC listener code to `arti`.Nick Mathewson2023-05-043-21/+129
| | | | | | | | | Now there's a module in `arti` that runs the loop for an RPC listener. The part of the old `listener` module that made the framed connections is now part of the `Session` object. There is now yet another a temporary location for the pipe; we should pick something better. At least now it's configurable.
* rpc: Make an RpcMgr type to own the DispatchTable.Nick Mathewson2023-05-041-1/+3
| | | | | | | | | In the future, this will probably hold more data as well, like a TorClient and some configuration info. The TorClient will present an issue; I've made comments about that. Closes #820
* Update our secmem_proc dependency to 0.3.0Nick Mathewson2023-04-131-1/+1
| | | | | | (This wasn't possible before we updated our MSRV to 1.65.) Closes #664.
* rpc: Add a demonstration feature to "arti"Nick Mathewson2023-04-121-0/+28
| | | | | | | | It's experimental, and tokio-only. To enable it, build with the "rpc" feature turned on, and connect to `~/.arti-rpc-TESTING/PIPE`. (`nc -U` worked for me) I'll add some instructions.
* Merge branch 'shadykaty-error-hint-v2' into 'main'eta2023-02-071-4/+11
|\ | | | | | | | | | | | | Create and use an ErrorHint type to report how to fix a problem. Closes #579 and #578 See merge request tpo/core/arti!994
| * ErrorHint: Report hints for arti_client errors.Nick Mathewson2023-01-271-4/+11
| |
* | Use ErrorReport - run rustfmtIan Jackson2023-01-301-1/+5
| | | | | | | | Split off for ease of review and possible rebase.
* | Use tor_error::Report for remaining errors in error! in artiIan Jackson2023-01-301-1/+1
| |
* | Apply safelog to DNS response serialisation errors, but report themIan Jackson2023-01-301-5/+11
| | | | | | | | | | | | With safe logging disabled, print the error too. With safe logging enabled, do not print the message or the error.
* | Use ErrorReport/Report for errors in warn! in artiIan Jackson2023-01-305-9/+13
|/
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-272-0/+2
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* resolve ip through socks by parsing themtrinity-1686a2023-01-031-15/+25
|
* arti: transports parsing: Record this as a ticketIan Jackson2022-11-301-4/+3
|
* arti, arti-client: Conditionalise various things on pt-clientIan Jackson2022-11-291-0/+1
|
* arti cfg tests: Add some more debug outputIan Jackson2022-11-291-0/+1
|
* bridge non-support: Test that we reject configsIan Jackson2022-11-211-4/+19
|
* bridge non-support: De-cfg the primary bridge config fieldsIan Jackson2022-11-211-3/+0
| | | | | | | | | | | | | | | | | | | | We now parse the `bridges.enabled` BoolOrAuto, and the `bridges.bridges` list. The `bridges.bridges` list is Vec<()> in the builder, and Vec<Void> in the built config. Ie, it is simply a count, and vanishes in the built config. But this count triggers us to try to call build(), to try to parse bridges, and to try to set and honour the enablement boolean. The result is that the type system now ensures that if bridges are disabled, but specified (either by listing them in the config, or writing `enabled=true`), we inevitably try to insist that we have a non-empty Vec<Void>, which is of course impossible. There will be a test case too for those who think this too abstract a way to guarantee this property :-).
* arti cfg test: Break out expect_err_contains functionIan Jackson2022-11-211-9/+15
| | | | | Maybe this will want to be in tor-error or something but put it here for now.
* bridge non-support: Disable the test for nowIan Jackson2022-11-211-0/+1
| | | | | | | | This test will start to fail if you compile without bridge support, because we'll start rejecting the test configurations with bridges specified. We'll add a proper test for this later.
* cfg compilation: Add two allowsIan Jackson2022-11-181-0/+1
|
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-3/+3
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* pt config, arti cfg test: Expect bridges.transports to be missingIan Jackson2022-11-161-2/+9
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/823#note_2854365
* arti cfg test: Coalesce expect_missingIan Jackson2022-11-161-0/+22
| | | | | | If there are subkeys which are covered by also expected_missing superkeys, delete them, since we expect the superkey to be missing, so the subkey won't show up.
* tor-ptmgr: make configuration use builders, plumb into arti-clienteta2022-11-161-0/+16
| | | | | | | This brings the draft configuration mechanisms in tor-ptmgr in line with the config in other crates, using builders. It also plumbs the config type through into the main `arti-client` config, and adds some example lines to `arti-example-config.toml`.
* arti cfg test: Document exhaustive_1 and comment exhaustiveIan Jackson2022-11-151-0/+39
|
* arti cfg test: Break out CONFIG_KEYS_EXPECT_NO_EXAMPLEIan Jackson2022-11-151-2/+9
| | | | Giving this a name will allow us to refer to it docs in a moment.
* arti cfg test: Drop a redundant allowIan Jackson2022-11-151-1/+0
| | | | | This allow is also present in the standard lint block at the start of the test inline module.
* Merge branch 'clap-v3' into 'main'Ian Jackson2022-11-081-34/+42
|\ | | | | | | | | | | | | Upgrade to clap 3 Closes #616 See merge request tpo/core/arti!830
| * Upgrade to clap 3: replace deprecated functionsGabriel de Perthuis2022-11-041-28/+36
| | | | | | | | | | | | | | | | | | | | | | Also replace Arg::takes_value with Arg::action to configure flags that don't take parameters vs options that do. This makes it easy to upgrade to clap 4. Tested deprecations with: cargo check --workspace --all-features --features clap/deprecated
| * Upgrade to clap 3 with minimal changesGabriel de Perthuis2022-11-041-6/+6
| | | | | | | | | | | | | | | | This removes the last cargo audit override (for the unmaintained ansi_term). Don't mark options as required when they have default values: see <https://github.com/clap-rs/clap/pull/3793>.
* | Spelling fixes and normalizations on some high-level cratesNick Mathewson2022-11-072-4/+4
| |
* | Fix typosDimitris Apostolou2022-11-061-3/+3
|/
* Run add_warnings.Nick Mathewson2022-11-032-0/+2
|
* debounce reload cfg eventstrinity-1686a2022-11-011-0/+7
|
* rename unused fieldtrinity-1686a2022-10-301-3/+2
|
* update some stringstrinity-1686a2022-10-301-10/+10
|
* use iife so we can try! instead of custom error handlingtrinity-1686a2022-10-301-64/+56
|
* refactor so events always indicate reloadtrinity-1686a2022-10-301-71/+74
|
* depends less on notify typestrinity-1686a2022-10-301-22/+35
|
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-186/+1
| | | | | | | | 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
* cfg tests: bridges: Document test case assumptionsIan Jackson2022-10-121-0/+19
|
* cfg tests: bridges: Remove now-redundant block { }Ian Jackson2022-10-121-13/+11
|
* cfg test: bridges: Test all three feature casesIan Jackson2022-10-121-4/+31
| | | | | | | | | | | | | This demonstrates that: * !bridge-client: uncommenting nondefault bridge config generates urecognized config key warnings (but the config is still accepted)( * bridge-client, !pt-client: uncommenting nondefault bridges generates error due to attempting to use a PT. If that's filtered out, everything is fine. * pt-client: Everything is good (as before).
* cfg tests: bridges: Prepare for more comprehensive testingIan Jackson2022-10-121-8/+20
| | | | | | | | | | | | | * Introduce filter_examples and resolve_examples helpers, which will become more complex in a moment. * Move the API test into a { } block to minimise subsequent diff. It's going to become conditional. * In subsequent comparisons, use the parsed version, since the API built one might not exist. No overall functional change.
* cfg tests: Make ExampleSectionLines::resolve fallibleIan Jackson2022-10-121-5/+5
|