summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/state.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+2
|
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-241-1/+2
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-201-0/+1
| | | | | | | This is so a relay can build authenticated channels. Several keys/cert are required for this that are within the key manager. Signed-off-by: David Goulet <[email protected]>
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-4/+4
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-051-23/+23
|
* Use new DisplayRedacted/DebugRedacted code for HsId.Nick Mathewson2025-07-311-6/+10
| | | | Closes #2012.
* Include "bug" in all bug error messagesNick Mathewson2025-04-281-2/+5
|
* fix `clippy::unneeded_struct_pattern`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Example: ```text warning: struct pattern is not needed for a unit variant --> crates/hashx/src/program.rs:165:32 | 165 | Instruction::Target { .. } => Opcode::Target, | ^^^^^^^ help: remove the struct pattern | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern note: the lint level is defined here --> crates/hashx/src/lib.rs:9:9 | 9 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::unneeded_struct_pattern)]` implied by `#[warn(clippy::all)]` ```
* Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-1/+1
|
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-1/+2
| | | | Fixes a TODO.
* Merge branch 'mq' into 'main'Ian Jackson2024-10-071-0/+2
|\ | | | | | | | | Implement memory quota tracking See merge request tpo/core/arti!2493
| * memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-0/+2
| | | | | | | | | | | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* | Merge branch 'rename-client-auth' into 'main'Ian Jackson2024-10-031-1/+1
|\ \ | |/ |/| | | | | | | | | Use the new "restricted discovery" terminology throughout Closes #1476 See merge request tpo/core/arti!2495
| * tor-hsclient: Use the new "restricted discovery" terminology.Gabriela Moldovan2024-10-031-1/+1
| | | | | | | | Part of #1476
* | CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-1/+1
|/
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-241-9/+11
| | | | | | | | | | This will allow for testing, as the CircuitBuilder can be replaced with a mocked version. This did require moving some of what was in the CircuitBuilder impl into the AbstractCircuitBuilder type, since Drop implementations can't be specialized, but that's fine, as we'll probably be doing more of that in the future anyways.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Create the VanguardMgr in CircMgr::new.Gabriela Moldovan2024-03-111-5/+0
|
* tor-circmgr: Give CircMgr a VanguardMgr.Gabriela Moldovan2024-03-111-0/+6
| | | | Closes #1277
* Convert to the latest versions of dalek-cryptographyNick Mathewson2023-11-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes that we have to adjust for are as follows: * In x25519-dalek: * `StaticSecret` is now behind a feature. * `StaticSecret::new` is deprecated in favor of `StaticSecret::random_from_rng`. * StaticSecret no longer does its own clamping. * In ed25519-dalek: * `SecretKey` has (in effect) been renamed to `SigningKey`. The name `SecretKey` is now an alias for `[u8; 32]`. * `SigningKey` is effectively a keypair, since it contains a public key as well. * `PublicKey` has been renamed to `VerifyingKey`. * The functions to extract a signing key and verifying key have been renamed as you might expect. * `ExpandedSecretKey` has been moved to `hasmat` and no longer implements `sign`. * `ExpanededSecretKey` now has as its elements a scalar and a hash prefix. * Various functions that took `&[u8]` now take `&[u8; N]`. * We no longer need a wrapper for older versions of rand. There is a single test in tor-keymgr that does not pass. I've marked it as ignore for now, in hopes that @gabi-250 can help me figure it out. This closes #808. There are several changes I want to make before we merge, however. They are marked with TODO DALEK.
* tor-hsclient: Deprecate HsClientSecretKeysBuilder::ks_hsc_intro_auth().Gabriela Moldovan2023-11-201-0/+1
|
* tor-rtmock: Switch MockRuntime to SimpleMockSleepProviderIan Jackson2023-10-031-1/+1
| | | | | | | | | | | | | | | | For now we do this by changing the meaning of the name `MockSleepProvider` in runtime.rs. This is a bodge to reduce noise in this diff. Consequences at call sites: * If the type is named somehow, the other type must be used. * SimpleMockTimeProvider calls it jump_wallclock rather than jump_to, which is IMO a better name. (MockRuntime will change in a moment.) * SimpleMockTimeProvider's advance() function isn't async and doesn't yield. But none of the call sites actually mind that.
* tor-hsclient: state expiry test: Use MockSleepProvider advanceIan Jackson2023-09-201-1/+2
| | | | | See https://gitlab.torproject.org/tpo/core/arti/-/issues/1040
* tor-hsclient: expiry tests: Use advance_byIan Jackson2023-09-181-1/+1
|
* tor-hsclient: expiry: Fix a boundary error in time calculationIan Jackson2023-09-181-1/+4
| | | | | We might loop, sleeping for zero. In real life this wouldn't last long, but with the mock executor it can busy loop.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run cargo +nightly fmt to format many let ... else ...Ian Jackson2023-07-241-17/+21
| | | | | | | | | | | rustfmt has grown opinions about how let ... else ... ought to be formatted. They don't always agree with our previous manual decisions. I think our policy is to always insist on rustfmt. When that version of rustfmt hits stable, our CI will start to fail for everyone. (Right now this discrepancy just causes trouble for contributors who are using nightly by default.)
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-071-13/+19
| | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* tor-hsclient: Abolish ad-hoc real-world-time sleepsIan Jackson2023-07-061-12/+4
| | | | | | Now we can reliably wait precisely for the tasks to be all waiting. This test case no longer involves any real executor.
* tor-hsclient: Reimplement Debug for MockCircIan Jackson2023-06-291-15/+12
| | | | | This is less code. Also it now dumps the connect_called field which was introduced in the meantime.
* HS configuration: Plumb configuration through (fmt)Ian Jackson2023-06-281-8/+14
| | | | Apply deferred rustfmt churn.
* HS configuration: Plumb configuration throughIan Jackson2023-06-281-1/+45
| | | | | Invent a trait a la circmgr config for the hs client connector config. Plumb a suitable value all the way through to the code that will use it.
* tor-hsclient: Increase some timeoutsIan Jackson2023-06-261-2/+2
| | | | | | | | | | | 1. Fix a use of 10ms that should have been TIMEOUT_SLOP. 2. Increase BODGE_YIELD by a factor of 5. Now this test should tolerate being hung up for 125ms. I am hoping that this will fix the CI failure https://gitlab.torproject.org/Diziet/arti/-/jobs/302457 which fails at the line comparing circuit1 with circuit2a. (I can't repro that locally.)
* tor-hsclient: test: Introduce some constants for timingsIan Jackson2023-06-261-5/+16
|
* tor-hsclient: test: Add another sleep for expiry task *start*Ian Jackson2023-06-261-0/+2
| | | | | | | Without this, the expiry task can end up choosing a 600s timeout starting *after we advanced the clock*. Fixes #923
* tor-hsclient: impl Debug by hand for MockCircIan Jackson2023-06-261-1/+18
| | | | | | | | The provided impl for Mutex is hopeless: it prints just some internal flags and doesn't acquire the mutex for printing purposes. At some point we might want to factor this out as a general function on `Arc<Mutex<...>>` but not now.
* Merge branch 'data' into 'main'Ian Jackson2023-06-261-8/+63
|\ | | | | | | | | tor-hsclient: Expire old IPT and HS descriptor data eventually See merge request tpo/core/arti!1290
| * tor-hsclient: Split out expire_old_data functionIan Jackson2023-06-261-0/+5
| | | | | | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1290#note_2915679
| * tor-hsclient: Add a TODO SPEC re data lifetimeIan Jackson2023-06-231-0/+2
| |
| * tor-hsclient: state tests: Test housekeeping (data expiry)Ian Jackson2023-06-231-0/+5
| |
| * tor-hsclient: state tests: Promote mk_hsconn callIan Jackson2023-06-231-1/+3
| |
| * tor-hsclient: state tests: Introduce connect_calledIan Jackson2023-06-231-5/+11
| | | | | | | | This will allow us to track when `Data` is discarded.
| * tor-hsclient: Expire old data eventuallyIan Jackson2023-06-231-2/+37
| | | | | | | | Otherwise we'll fill up our RAM with junk.
* | tor-hsclient: Add a TODO SPEC re circuit dirtinessIan Jackson2023-06-231-0/+2
|/
* tor-hsclient: Add a note about circuit expiry uncertainty, ticketIan Jackson2023-06-221-0/+3
|
* tor-hsclient: Expand explanation of `last_used` (for Open)Ian Jackson2023-06-221-1/+20
|
* tor-hsclient: Make comment about circuit expiry more accurateNick Mathewson2023-06-221-1/+2
|
* tor-hsclient: Apply broken formatting as demanded by rustfmtIan Jackson2023-06-221-1/+1
|