aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src
Commit message (Collapse)AuthorAgeFilesLines
...
* rpc: revise session initialization a lot.Nick Mathewson2023-06-151-7/+8
| | | | | | | | | | | | | | Formerly, every time we wanted to launch a new connection, we had to give the RpcMgr a TorClient. The connection would hold that TorClient until a session was authenticated, and then would wrap it in a Session and put it in the object map. Now, the RpcMgr holds a Box<dyn Fn()...> that knows how to create Sessions. When a connection is authenticated, it asks the Mgr to make it a new session. This lets us make it clearer that the TorClient simply can't be given out until the connection is authenticated. Later, it will let us create more types of Session objects under more complicated rules.
* RPC: rename new_session to new_connectionNick Mathewson2023-06-151-1/+1
|
* rpc: revise the relationship between Mgr and ConnectionNick Mathewson2023-06-141-1/+1
| | | | | | | | This adds a Weak reference from Connection to Mgr, makes DispatchTable mutable, and makes a few other changes as discussed between me and Diziet the other week. I bet we are not done tweaking this, but I hope it's a setp forwards.
* RPC: Suppress a warning to do with RPC and SOCKSIan Jackson2023-06-131-0/+1
| | | | Fixes `cargo check`
* arti: Interpret socks request to mean "lookup an RPC session"Nick Mathewson2023-06-051-13/+104
| | | | | | | | | The actual decoding here is just a placeholder. The important part is that we can get either a (SessionId, StreamId) tuple out of the request, or we treat it as part of an isolation token. This commit has a few TODOs for additional things that we'll need in order to build out our design.
* arti: Move SOCKS code for building StreamPrefs and getting a TorClient.Nick Mathewson2023-06-051-12/+25
|
* arti: Add an alias in the SOCKS code for per-conn isolatino info.Nick Mathewson2023-06-051-4/+10
| | | | This enables some small simplifications.
* RPC: tell the `arti` SOCKS code about an RpcMgr object.Nick Mathewson2023-06-053-23/+78
| | | | | It will use this to find which TorClient to use when opening a stream.
* rpc: Move Arc::new() to RpcMgr code.Nick Mathewson2023-06-051-2/+2
|
* 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
|