summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | tor-proto: implement tokio Async{Read, Write} traits conditionallyeta2021-10-194-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | futures::io::AsyncRead (and Write) isn't the same thing as tokio::io::AsyncRead, which is a somewhat annoying misfeature of the Rust async ecosystem (!). To mitigate this somewhat for people trying to use the `DataStream` struct with tokio, implement the tokio versions of the above traits using `tokio-util`'s compat layer, if a crate feature (`tokio`) is enabled.
* | | Move TorClientBuilder into tor_client::config, for consistency.Nick Mathewson2021-10-193-61/+62
| | |
* | | Make elements of TorClientConfig private.Nick Mathewson2021-10-193-18/+15
|/ /
* / tor-client: refactor TorClient::bootstrap's args into a config objecteta2021-10-199-30/+97
|/ | | | | | | | | | | | | The three arguments TorClient::bootstrap requires by way of configuration have been factored into a new TorClientConfig object. This object gains two associated functions: one which uses `tor_config`'s `CfgPath` machinery to generate sane defaults for the state and cache directories, and one that accepts said directories in order to create a config object with those inserted. (this commit was inspired by trying to use arti as a library and being somewhat overwhelmed by the amount of config stuff there was to do :p)
* Fix some typos in comments.Nick Mathewson2021-10-194-6/+6
| | | | Also, tell the "typos" tool to ignore Cargo.lock.
* Reverse two swapped log messagesNick Mathewson2021-10-191-2/+2
|
* Improve logging when trying to get the lock on the directory cache.Nick Mathewson2021-10-191-3/+20
| | | | | | Previously we'd say that we were "waiting for the other process to bootstrap" even if it was already bootstrapped: and we wouldn't actually declare success when it was done.
* Remove Guard::get_relay(); use Guard::guard_id().get_relay().Nick Mathewson2021-10-191-12/+4
| | | | | | | | | The `get_relay` function was confusing, since it would return None if the relay was present, but wasn't actually a guard. We only used it in one place, and in that one place we used it wrong, leading to a panic bug. Fixes #193.
* Upgrade to latest chrono; update cargo_audit.shNick Mathewson2021-10-192-34/+35
| | | | | | | | | | | | Thanks to the chrono update, we no longer include an obsolete/vulnerable version of the `time` crate. Unfortunately, it turns out that chrono has the same trouble as `time`: it, too, looks at the environment via localtime_r, and the environment isn't threadsafe. One step forward, one step back. At least the underlying issue is one that lots of people seem to care about; let's hope they come up with a solution.
* Remove special-case for ipv6 in is_valid_hostnameNick Mathewson2021-10-181-10/+2
|
* Use a proper RFC5737 address in tests.Nick Mathewson2021-10-181-2/+2
|
* Add the "clock" feature to chrono in netdoc.Nick Mathewson2021-10-181-1/+1
| | | | | | This seems to fix a bug when running cargo check on netdoc individually. Reported by @janimo
* Move hostname enforcement into TorAddr.Nick Mathewson2021-10-182-97/+132
|
* Change how we connect to target addresses.Nick Mathewson2021-10-185-9/+262
| | | | | | | Now we all both address:port, (address, port), and more. We also allow SocketAddr and IpAddr, but only via a trait labeled as "Dangerous".
* Remove "internal" address checking to its own function.Nick Mathewson2021-10-181-38/+45
|
* Merge branch 'reject_bad_hostnames'Nick Mathewson2021-10-187-3/+146
|\
| * Rename is_localhost to allow_local_addrs, and apply it to IPs too.Nick Mathewson2021-10-183-8/+13
| |
| * Formatting fixesNeel Chauhan2021-10-062-5/+9
| |
| * Make is_valid_hostname() globalNeel Chauhan2021-10-061-44/+45
| |
| * Add unit tests for hostnamesNeel Chauhan2021-10-061-4/+34
| |
| * Introduce ClientConfig for is_localhost config parameterNeel Chauhan2021-10-067-7/+59
| |
| * Hostname corrections and add IPv6 hostname validation supportNeel Chauhan2021-10-061-5/+15
| |
| * Reject bad hostnames and internal addresses in ArtiNeel Chauhan2021-10-061-0/+39
| |
* | Commit change to cargo.lock.Nick Mathewson2021-10-181-1/+0
| |
* | Do not use downcast_ref, use tor-client error.Jani Monoses2021-10-181-8/+6
| |
* | Remove anyhow usage in tor-client.Jani Monoses2021-10-184-5/+65
| |
* | Remove useless into() conversions caught by clippy.Jani Monoses2021-10-185-28/+30
| |
* | Update Cargo.lock.Jani Monoses2021-10-181-1/+1
| |
* | Remove anyhow dependency from tor-dirmgr.Jani Monoses2021-10-184-13/+62
| |
* | Use unwrap in tests.Jani Monoses2021-10-181-9/+15
| | | | | | | | | | | | | | | | | | For now, this avoids having to separately handle AuthorityBuilderError, DirMgrConfigBuilderError, DownloadScheduleConfigBuilderError, NetworkConfigBuilderError and FallbackDirBuilderError when anyhow is not used. Turn off a clippy warning.
* | Use append in place of extend_from_slice in DataReaderImpl::add_data.Nick Mathewson2021-10-171-2/+2
| | | | | | | | Suggested by @cheako.
* | Add in first cargo-audit exception, as an example.Nick Mathewson2021-10-171-0/+19
| |
* | Add an ignored cargo-audit warning, with appropriate documentationNick Mathewson2021-10-171-2/+35
| |
* | Move "cargo audit" invocation into a script.Nick Mathewson2021-10-172-1/+9
| |
* | Turn off default-features in chrono where possible.Nick Mathewson2021-10-172-2/+2
| |
* | Add a cast to correct a type error about WSAEMFILENick Mathewson2021-10-151-1/+7
| |
* | Update const-oid: the previous version has been yanked.Nick Mathewson2021-10-151-2/+2
| |
* | arti: On startup, increase the NOFILE resource limit.Nick Mathewson2021-10-144-0/+39
| | | | | | | | | | | | | | | | | | | | | | The default soft limit is typically enough for process usage on most Unixes, but OSX has a pretty low default (256), which you can run into easily under heavy usage. With this patch, we're going to aim for as much as 16384, if we're allowed. Fixes part of #188.
* | proxy: Mark ENFILES and EMFILES as survivable.Nick Mathewson2021-10-143-2/+35
| | | | | | | | | | | | | | | | I don't love this approach, but those errors aren't distinguished by ErrorKind, so we have to use libc or winapi, apparently. At least nothing here is unsafe. Addresses part of #188.
* | Add a few tracing directives to tor-dirmgr.Nick Mathewson2021-10-133-3/+14
| |
* | tor-dirmgr: report bootstrap success on all successful cases.Nick Mathewson2021-10-131-0/+5
| | | | | | | | | | Previously we would sometimes fail to report that we had successfully bootstrapped.
* | Fix a documentation link error.Nick Mathewson2021-10-131-4/+2
| |
* | Report errors in logging configuration a bit more usefullyNick Mathewson2021-10-131-2/+22
| |
* | Document trace_filter example in main.rs too.Nick Mathewson2021-10-131-0/+2
| |
* | Don't report the bootstrap as completed unless it actually succeeds.Nick Mathewson2021-10-132-5/+14
| | | | | | | | | | (Previously we'd report it as successful even if the inner download task was a failure.)
* | Use better reporting for guard status.Nick Mathewson2021-10-135-24/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | The previous code would report all failures to build a circuit as failures of the guard. But of course that's not right: If we fail to extend to the second or third hop, that might or might not be the guard's fault. Now we use the "pending status" feature of the GuardMonitor type so that an early failure is attributed to the guard, but a later failure is attributed as "Indeterminate". Only a complete circuit is called a success. We use a new "GuardStatusHandle" type here so that we can report the status early if there is a timeout.
* | Rename GuardStatusMsg, make it public, add an `Indeterminate` case.Nick Mathewson2021-10-133-26/+43
| |
* | Implement guards for multihop paths.Nick Mathewson2021-10-133-26/+87
| | | | | | | | There are some limitations here, as noted in the comments.
* | Actually select guards for directory circuits.Nick Mathewson2021-10-134-13/+27
| |
* | Pass the guard manager down to the path selection functions.Nick Mathewson2021-10-116-14/+38
| |