Commit Graph

1378 Commits

Author SHA1 Message Date
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
Nick Mathewson 19e0558bcd Fix some CI warnings. 2021-07-31 18:01:25 +02:00
Nick Mathewson 4374ba4738 Fix some CI warnings. 2021-07-30 17:38:54 -04:00
rls 0587e97c7b Change output type in DirResponse to Vec<u8>
Previously the DirResponse contained a String for the output.
By changing it to a Vec<u8> the caller has to parse the Vec<u8> and deal with potential failures.

With this change `fetch_multiple`'s
`useful_responses` should also contain non-UTF-8 responses.
This will case an Err to be returned in the `download_attempt` function if the
DirResponse does not contain valid UTF-8.
2021-07-30 22:41:33 +02:00
Nick Mathewson af90626ab8 Add a note about the other (current) daemon task. 2021-07-30 15:24:43 -04:00
Nick Mathewson 7fda771f45 Whenever the consensus changes, inform the circmgr about new params
Closes #144
2021-07-30 15:16:43 -04:00
Nick Mathewson cc6302deda Give DirMgr the ability to notify subscribers about events.
This is not 100% what we'll want long term:
  - We might want more kinds of events
  - We'll probably want to generate them in a more reliable way
  - We might want some of this mechanism to be in a crate other than
    DirMgr.

But for now, let's use this as a start and get experience with it.
2021-07-30 12:53:54 -04:00
Nick Mathewson 95e8f67a4a Disable a warning from Rust 1.54 2021-07-29 10:49:40 -04:00
Nick Mathewson 6dbdfdcc84 Add a kludge to make resolve requests work.
Apparently "a circuit supporting no target ports" is not truly an
exit circuit.  We should add a better fix here, however.
2021-07-27 13:53:56 -04:00
Nick Mathewson 4ccc4cecfe Now that we support RESOLVE*, log what SOCKS command we are seeing 2021-07-27 13:49:57 -04:00
Nick Mathewson 9c8dcecf20 socksproto: Allow port 0 for RESOLVE and RESOLVE_PTR. 2021-07-27 13:48:24 -04:00
Nick Mathewson 962b01ca4e Do not try to resolve .onion addresses. 2021-07-27 13:19:32 -04:00
Nick Mathewson be05441cfb tor-client: rename circ function to a more descriptive name 2021-07-27 13:18:44 -04:00
Nick Mathewson b40b5d9412 tor_proto: Use iterators and functions to simplify resolve functions. 2021-07-27 13:13:27 -04:00
Nick Mathewson 64daf41a9b ResolvedVal: Rename answers() to into_answers(). 2021-07-27 13:00:25 -04:00
Nick Mathewson 26f00ed396 tor-proto: Tweak documentation for resolve/resolve_ptr 2021-07-27 12:58:33 -04:00
Nick Mathewson a6a0189449 Merge remote-tracking branch 'origin/mr/39' 2021-07-27 10:38:20 -04:00