summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/replay.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
* tor-hsservice: Replace `libc::EFBIG` with `io::ErrorKind::FileTooLarge`hashcatHitman2025-09-011-2/+1
| | | | | | | | Resolved an MSRV TODO. We used `libc::EFBIG` previously because `io::ErrorKind::FileTooLarge` was still unstable. It has since stabilized and entered our MSRV (>= 1.83.0). Signed-off-by: hashcatHitman <[email protected]>
* tor-hsservice: Small typo correctionhashcatHitman2025-09-011-1/+1
| | | | | | | Unless this is a pun, I'm pretty sure this is supposed to be `EFBIG` and not `EFBUG`. Signed-off-by: hashcatHitman <[email protected]>
* tor-hsservice: Add PowManager to OnionServiceStatus.Wesley Aptekar-Cassels2025-08-131-1/+1
|
* tor-hsservice: Change ReplayLog error type.Wesley Aptekar-Cassels2025-08-131-2/+13
| | | | | | | | This disentangles the ReplyLog from the IptManager. This will allow us to make the InternalPowError type more public (in order to use it in the OnionServiceStatus code) without also having to make the CreateIptError type more public.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* tor-hsservice: Add PowNonceReplayLog.Wesley Aptekar-Cassels2025-05-271-0/+6
|
* tor-hsservice: standardized MSRV TODOhashcatHitman2025-04-161-1/+1
| | | | | - Part of a series of commits aimed at replacing all MSRV-related TODOs with a standardized format, which should be easier to find when the MSRV is bumped.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* tor-hsservice: Change replay/mod.rs to replay.rs.Wesley Aptekar-Cassels2025-02-101-0/+736
| | | | We have a new lint that requires this.
* tor-hsservice: Make directory for replay module.Wesley Aptekar-Cassels2025-02-101-740/+0
| | | | | This will shortly become multiple files, so it will be helpful to have it in a directory.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-hsservice: prelude: Move imports from replay.rsIan Jackson2024-03-051-12/+4
|
* tor-hsservice: Move svc.rs contents into lib.rsIan Jackson2024-03-051-1/+1
|
* Make test_partial_write linux-only.Nick Mathewson2024-02-291-1/+1
| | | | | | This is a temporary workaround for #1307: In `libc`, struct sigaction doesn't seem to have the same fields on all the unix platforms.
* tor-hsservice: replay: Fix an error message slightlyIan Jackson2024-02-131-1/+1
| | | | | On Windows filenames are WTF-16, not bytes, so a weird filename fails to be UTF-16 rather than failing to be UTF-8.
* tor-hsservice: replay: Move replay filename knowledge into replay.rs (fmt)Ian Jackson2024-02-131-10/+5
|
* tor-hsservice: replay: Move replay filename knowledge into replay.rsIan Jackson2024-02-131-14/+53
|
* tor-hsservice: replay log test: Check SIGUSR2 status on entryIan Jackson2024-02-121-0/+35
| | | | Will make the situation in #1264 clear, I think.
* tor-hsservice: replay log test: Break out sigemptyset()Ian Jackson2024-02-121-3/+7
|
* tor-hsservice: replay log test: Plumb output manuallyIan Jackson2024-02-121-2/+13
| | | | | | | | | Something libtest is doing hides the child stderr/stdout from the test log, when --nocapture is not given. With these changes, I see much more output in failing cases or with --nocapture. In the case mentioned in #1264, the message "we survived raise SIGUSR2" is now printed both with and without --nocapture.
* Fix compilation with musl.Nick Mathewson2024-02-061-3/+3
| | | | | | | | Don't try to name the type of `RLIMIT_FSIZE` in our tests: its type is either `c_int` or `__rlimit_resource_t` depending on the libc instance. Closes #1264.
* tor-hsservice: Drop now-unused fslock dependencyIan Jackson2024-02-011-1/+0
| | | | We're just using fslock-guard now.
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | We no longer do replay log locking in IptManager::new. Instead, we rely on the acquire_instance call in OnionService::launch, which ends up with ipt_mgr getting an InstanceHandle (which contains a lock guard). OnionServiceStateMgr is abolished; it existed to deal with the generics in the tor_persist::StateMgr API. state_dir has no generics (other than the T being loaded/stored). Many places (structs and argument lists) now have state_dir types which embody a path (or a CheckeDir) along with a lock, rather than separate path+lock+mistrust. The creation/startup code uses the new calls from state_dir. Other more minor changes: - StartupError::StateDirectoryInaccessible contains tor_persist::Error - test::create_storage_handles_from_state_dir changed and renamed, from _from_state_mgr. - replay::PersistFile's (separate) file lock is now fslock_guard's
* test-temp-dir: New crateIan Jackson2024-01-251-2/+1
| | | | | Introduce the crate, move the code motion, and make minimal necessary changes.
* tor-hsservice: replay: partial write test - commentaryIan Jackson2024-01-251-0/+29
|
* tor-hsservice: replay: partial write testIan Jackson2024-01-251-2/+114
|
* tor-hsservice: replay: partial write test, skeletonIan Jackson2024-01-251-0/+40
|
* test_temp_dir: Split up .used_byIan Jackson2024-01-251-2/+2
| | | | | | | | | | This method combined two things: 1. the lifetime guard API 2. creation of a subdirectory. 2 is available in raw form too, but not 1. So rename the combined method to .subdir_used_by and implement it in terms of a new .used_by which doesn't make a subdirectory.
* tor-hsservice: Recover from partial writesIan Jackson2024-01-251-2/+29
| | | | Fixes #1207.
* tor-hsservice: replay: Introduce an EH IEFE (fmt)Ian Jackson2024-01-251-2/+1
|
* tor-hsservice: replay: Introduce an EH IEFEIan Jackson2024-01-251-7/+11
| | | | | We're going to want to do more things here, all of which want the same error handling.
* tor-hsservice: replay: Combine PersistFileIan Jackson2024-01-251-16/+25
| | | | | This combines two logically-parallel options. Also, it provides us a place to put another piece of information we want in a moment.
* tor-hsservice: replay: Break out truncate_to_multipleIan Jackson2024-01-251-8/+13
|
* tor-hsservice: replay: Break up a paragraphIan Jackson2024-01-251-1/+3
|
* tor-hsservice: todos: Remove blanket allowIan Jackson2024-01-111-2/+0
| | | | We now have more fine-grained allows.
* tor-hsservice: todos: reference a new ticket about flushingIan Jackson2024-01-111-0/+1
| | | | | Deciding what to do about this *is* a MUST, but maybe we'll downgrade that ticket.
* tor-hsservice: todos: reference a new ticket about the partial write bugIan Jackson2024-01-111-1/+1
| | | | This *is* a MUST.
* tor-hsservice: todos: reference the ephemeral services ticketIan Jackson2024-01-111-0/+1
| | | | This isn't a MUST.
* Fix typosDimitris Apostolou2024-01-081-1/+1
|
* tor-hsservice: replay: Note a bugIan Jackson2023-12-131-0/+4
|
* tor-hsservice tests: replay: Provide for a filesystem lockfileIan Jackson2023-12-131-2/+22
| | | | | This is to prevent current use of the same directory of replay logs by different instances.
* tor-hsservice tests: replay: Break out create_loggedIan Jackson2023-12-131-13/+25
|
* tor-hsservice: ReplayLog: Fix file magicIan Jackson2023-12-131-1/+1
| | | | | | | | | | This ought to have the hash algorithm name in it or we'll have trouble if we want to change the hash algorithm in the future. (Strictly, we could just choose a different magic but the string was rather short.) Add a newline, which is often convenient in file headers. And "onion" to mean "onion swervice" is improper.
* tor-hsservice: ReplayLog: Slight tidying upIan Jackson2023-12-131-3/+5
| | | | Make `#[cfg(target_family = "unix")]` appear only once.
* replay: Remove false-positive special-casing in testsNick Mathewson2023-11-021-31/+10
| | | | | | (The actual false positive rate for these cases is very small, since the filters are very much not full. I haven't been able to hit one in hours of looping.)
* Add a missing backtick.gabi-2502023-11-021-1/+1
|
* Use io::Result to shorten return type.gabi-2502023-11-021-1/+1
|
* hss: Add functionality for a persistent replay log.Nick Mathewson2023-11-021-0/+421
See comments for design notes.