Commit Graph

1544 Commits

Author SHA1 Message Date
Nick Mathewson 100042b85d Add ability to launch a circuit to _some_ exit, without giving ports.
We'll want this for testing circuits and for RESOLVE requests.

Closes #155.
2021-08-11 13:03:24 -04:00
Nick Mathewson b4bb082153 Add functions to check whether port policies are nonempty. 2021-08-11 12:32:21 -04:00
David Goulet f9c23bc376 fallbackdir: Regenerate list
Closes #160

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-11 09:15:55 -04:00
Nick Mathewson f2be513fe6 Bump to latest arti-corpora. 2021-08-11 08:51:35 -04:00
Nick Mathewson 648a822e3a Upgrade to latest fslock and use its per-fd exclusion feature.
The latest version of the fslock crate has an optional feature that
allows file-locks to exclude one another even if they are opened
within the same process.  On Windows this behavior comes for free;
on Unix it depends on an internal map of (dev,inode) pairs.

Here we upgrade to the latest version of the fslock crate, and use
this feature.
2021-08-11 07:15:08 -04:00
Lennart Kloock ea21b95dcc
Fix previously fixed typos in docs too 2021-08-10 22:28:11 +02:00
Lennart Kloock 5f202a30fd
Fix a typo in tor-rtmock README.md
Remove a '#'
2021-08-10 21:39:07 +02:00
Lennart Kloock 1186de6df8
Fix a few typos in tor-rtcompat README.md 2021-08-10 21:24:39 +02:00
Lennart Kloock 10226872a0
Fix typo in tor-rtcompat README.md
Change 'if' to 'is'
2021-08-10 21:12:24 +02:00
Nick Mathewson 5f7f845d60 Use the correct unused-circuit timeout when we're learning timeouts. 2021-08-10 15:06:22 -04:00
Nick Mathewson 779e234c4c Make a basic daemon task to close circuits.
The timing is not ideal here; we'll want to refactor it later.

Closes #51
2021-08-10 11:13:32 -04:00
Nick Mathewson cb9319c468 Use real network parameters to set unused-circ timeouts. 2021-08-10 10:46:31 -04:00
Nick Mathewson 6b0c93fa81 Initial code to expire unused circuits. 2021-08-10 10:02:14 -04:00
Nick Mathewson 4238ed3ae9 Make MAX_CIRC_DIRTINESS configurable. 2021-08-10 09:37:38 -04:00
Nick Mathewson a81e148b94 Note functionality that maybe could move. 2021-08-10 09:34:40 -04:00
Nick Mathewson e1a2740a45 Have CircMgr::new() return an Arc<>. 2021-08-10 09:32:52 -04:00
Ben Armstead 41a7171581 Update state.rs info message 2021-08-09 20:08:07 +00:00
Nick Mathewson de00b5f512 Merge remote-tracking branch 'origin/mr/51' 2021-08-09 16:00:53 -04:00
Nick Mathewson 173580533f Refactor double_timeout() to make its timeouts futures in advance
Since these futures rely on the current time when they decide when
to expire, we don't want them looking at the current time from
inside the call to runtime.spawn or after that call.  Instead we'd
like them to look immediately on construction.

This approach is based on a comment from janimo on #149.  It doesn't
fix #149, though.
2021-08-09 12:53:45 -04:00
Nick Mathewson abb3e2fad5 Light edits on CONTRIBUTING.md
Mainly, drop the suggestion to fetch submodules, and explain what
more things do.

(The only submodule we have now is the fuzzing corpora, which most
people won't want.)

(I am not 100% convinced that we should keep 100% of the
instructions for working with git in the long term.  Do many other
projects have these?  Is there a tutorial we should link to
instead?)
2021-08-09 12:42:10 -04:00
Nick Mathewson 4edb88b7c2 Merge remote-tracking branch 'origin/mr/54' 2021-08-09 12:38:09 -04:00
Nick Mathewson 5c9aba8b69 Flush persistent state periodically, and on (clean-ish) exit. 2021-08-09 10:07:03 -04:00
Nick Mathewson d01d9643f0 Don't try to lock an already-locked lockfile.
Also, remove a dbg
2021-08-09 10:06:41 -04:00
S0AndS0 dea85e7912 WIP: Add development environment setup tips 2021-08-06 15:31:45 -07:00
Nick Mathewson af750e2010 Implement initial persistence for circuit timeout data
There's more to do here: we never actually store the data we get
here, and we won't work at all when somebody else has the lock.
2021-08-06 16:39:50 -04:00
Nick Mathewson bb6d38cde0 Initial persistent-state-manager code.
This commit defines a crate (tor-persist) that describes an abstract
key-value store using serde, plus an on-disk implementation using
Toml and fslock.
2021-08-06 16:39:50 -04:00
Nick Mathewson 79d9eac58c Add unnecessary_wraps to the big warning list. 2021-08-06 16:20:37 -04:00
Nick Mathewson e0ddb522c7 Update READMEs. 2021-08-06 11:00:34 -04:00
Nick Mathewson db64970202 Update arti-corpora to latest. 2021-08-06 09:45:52 -04:00
Nick Mathewson 6d80e53232 Simplify SqliteStore::from_path 2021-08-06 09:33:09 -04:00
Felipe Lema bf3c422555 shrink result to actual number of bytes read once on return 2021-08-05 20:08:18 -04:00
Nick Mathewson ca6b38d49e Missing tor-circmgr/src/config.rs 2021-08-05 17:16:28 -04:00
Nick Mathewson 80745dffcd Update to rsa 0.5.0. Minor compatibility issues. 2021-08-05 17:11:44 -04:00
Nick Mathewson 460f4d7dc6 Make circuit building and management configurable from the CLI. 2021-08-05 16:50:32 -04:00
Nick Mathewson 38ddf68c8c Add a configuration structure for CircMgr.
This patch makes path configuration and request timing options get
exposed up to the tor-client level.  I'm trying `derive_build` here
so we can eventually get consistent across all our builders.
2021-08-05 16:30:44 -04:00
Nick Mathewson e4baf164dd Small cleanups and tweaks to same_subnet code. 2021-08-05 15:16:03 -04:00
Nick Mathewson 3bc0a03848 Merge remote-tracking branch 'origin/mr/45' 2021-08-05 14:59:34 -04:00
Felipe Lema 161d5312bd fix clippy::redundant_slicing 2021-08-05 01:21:48 -04:00
Felipe Lema 49cf119e18 use loop + `read` + slice-of-result
Loop into several reads because we want to short-circuit if case we're
reading too many bytes.

Added handling of allocation of `result` so we can use the "next window
buffer" for `read`. This way we can read on steps and short-circuit when
needed.
2021-08-05 00:34:40 -04:00
Nick Mathewson ac962a7665 Remove spurious "exit 0" 2021-08-04 16:04:24 -04:00
Nick Mathewson 7c9373a32f Add my "fuzz everything" script that I like to run overnight 2021-08-04 15:59:36 -04:00
Nick Mathewson ec6ec3f1d8 Update arti-corpora submodule. 2021-08-04 15:57:02 -04:00
rls c813eb1a10 Add symlinks to arti-corpora 2021-08-04 15:52:24 -04:00
Felipe Lema 5277c747d5 read from stream in a single go (not looping) 2021-08-03 16:08:53 -04:00
Felipe Lema dcfcf09956 don't use intermediate buffer, but read directly into `result` 2021-08-03 16:08:53 -04:00
Nick Mathewson 87edb38920 Small fixes on top of typo fixes 2021-08-03 09:01:46 -04:00
Nick Mathewson 6e04a3b0f7 Merge remote-tracking branch 'origin/mr/48' 2021-08-03 08:49:25 -04:00
Smitty 3100a6a6ae Support EnforceDistinctSubnets
Relays on the same IPv4 /16 or IPv6 /32 are treated as being in the same
family.
2021-08-01 19:01:06 -04:00
rls 297ca28170 Revert spelling change; "recognised" is valid 2021-07-31 18:21:18 +02:00
rls 51d91508f7 Fix typos and other spelling mistakes 2021-07-31 18:02:35 +02:00