Commit Graph

3984 Commits

Author SHA1 Message Date
Nick Mathewson a0c48caa46 CircMgr: Update to new NetDirProvider API
Everything here wants a timely directory, except that it is okay
to build timeout-testing circuits with a stale one.
2022-07-26 10:41:06 +01:00
Nick Mathewson ad577b48f2 ChanMgr: Only update parameters from a timely directory. 2022-07-26 10:41:06 +01:00
Nick Mathewson 0bca4d825c GuardMgr: Update to use new NetDirProvider API. 2022-07-26 10:41:06 +01:00
Nick Mathewson de460b0668 Remove unused DirMgr::netdir method, make opt_netdir private. 2022-07-26 10:41:06 +01:00
Nick Mathewson c39aa5de73 Add new APIs to NetDirProvider to better support timeliness.
Over the years we've found that most callers who want a netdir want
what C Tor calls a "reasonably live" network directory: One that is
not expired by too much, or too far in the future. But a few want a
_strictly_ live directory: one that says it is valid now, with no
tolerances.  And a few want _any_ directory, no matter how expired
it is.

This commit adds net methods to NetDirProvider to provide these
directories.  I think that most use cases will want to explicitly
think about what kind of directory they want, so I've made `netdir`
the simplest method.  I might remove `timely_netdir` by the end of
this branch; see TODO comments.

Part of #518.
2022-07-26 10:40:53 +01:00
eta 7537739a75 Merge branch 'ticket_503' into 'main'
Rename DirSkewTolerance to DirTolerance, download_tolerance to dir_tolerance

Closes #503

See merge request tpo/core/arti!638
2022-07-25 20:21:04 +00:00
Nick Mathewson d1e91be382 Merge branch 'cert-api-improv-bis' into 'main'
use Ed25519 identity instead of PublicKey in tor-cert::rsa

Closes #512

See merge request tpo/core/arti!643
2022-07-25 19:25:36 +00:00
trinity-1686a 61eb0c4f35 use Ed25519 identity instead of PublicKey in tor-cert::rsa 2022-07-25 20:46:01 +02:00
Nick Mathewson 04f0ce8ee4 Merge branch 'cert-api-improv' into 'main'
change usage of PublicKey to Ed25519 in tor-cert

Closes #512

See merge request tpo/core/arti!641
2022-07-25 13:53:53 +00:00
trinity-1686a eed8032dbd fix nighly clippy 2022-07-23 20:25:33 +02:00
trinity-1686a 8c28622ecb change usage of PublicKey to Ed25519 in tor-cert
and propagate to other affected crates
2022-07-23 20:07:25 +02:00
trinity-1686a 8def416144 change check_key to take a Option<&_> instead of &Option<_> 2022-07-23 18:38:31 +02:00
Ian Jackson bb3dbb0764 Merge branch 'onion-service-fixup' into 'main'
Fix compilation of EstablishInto encoding.

See merge request tpo/core/arti!640
2022-07-22 14:51:01 +00:00
Nick Mathewson bc75e6402b Fix compilation of EstablishInto encoding.
It was based on the old `Writeable` API.
2022-07-22 10:30:01 -04:00
Nick Mathewson 3066aeff18 Rename download_tolerance to directory_tolerance
Closes #503.
2022-07-22 10:14:36 -04:00
Nick Mathewson 41104137b1 Rename DirSkewTolerance to DirTolerance
This name is more accurate because we aren't only dealing with
clock skew here: we're also trying to tolerate the case where the
authorities fail to reach consensus for a while.
2022-07-22 10:04:25 -04:00
eta 274bfb94c7 Merge branch 'hs-cells' into 'main'
Implement ESTABLISH_INTRO relay cell

See merge request tpo/core/arti!626
2022-07-22 13:42:50 +00:00
Nick Mathewson 4f7c63adea Merge branch 'arti_client_error_cleanup' into 'main'
Clean-ups to error variants in arti-client

See merge request tpo/core/arti!637
2022-07-21 13:48:37 +00:00
Nick Mathewson 6039461a8a arti-client: Split "Persist" into setup and access variants. 2022-07-21 09:08:33 -04:00
Nick Mathewson fb558fdfb5 arti_client: turn "Proto" error into StreamFailed. 2022-07-21 09:08:33 -04:00
Nick Mathewson 4a97ad4632 arti_client: Split DirMgr error into useful types. 2022-07-21 09:08:33 -04:00
Nick Mathewson fd56ec9698 arti-client: minor edits in error messages and comments 2022-07-21 09:08:33 -04:00
eta 75b1801156 Merge branch 'phf_min_vers' into 'main'
Downgrade phf back to 0.10

See merge request tpo/core/arti!636
2022-07-20 19:07:49 +00:00
Nick Mathewson cf02d9990c Also downgrade serde_with: Version 2.0 requires Rust 1.60 2022-07-20 11:45:19 -04:00
Nick Mathewson 3ad312320e Downgrade phf back to 0.10
It turns out that phf 0.11 depends on Rust 1.60, which is above our
MSRV.
2022-07-20 10:48:28 -04:00
eta 87f4f6a152 Merge branch 'unicode-license' into 'main'
Teach check_licenses to accept license on `unicode-ident`.

See merge request tpo/core/arti!635
2022-07-20 14:32:54 +00:00
Nick Mathewson 275c98940a Teach check_licenses to accept license on `unicode-ident`.
The license there is `(MIT OR Apache-2.0) AND Unicode-DFS-2016`,
which fine, but the existing shell script doesn't actually handle
"AND" correctly.  This commit adds a workaround for licenses that
are "AND", and some comments about weaknesses in our (lack of)
boolean expression parsing.

This should fix CI.
2022-07-20 09:40:12 -04:00
eta a2cb2664bb Merge branch 'permission-var' into 'main'
disable-fs-permission-checks: remove variable from help message

See merge request tpo/core/arti!633
2022-07-20 13:25:30 +00:00
Nick Mathewson 393147e55e Run "cargo update" in preparation for next week's releases. 2022-07-20 08:37:13 -04:00
Jim Newsome 0c82c3f885 disable-fs-permission-checks: remove variable from help message
This option doesn't take an argument. This change drops the argument
from the `--help` message.
2022-07-19 16:04:01 -05:00
Nick Mathewson 131d880c7f Upgrade to latest phf, serde_with, serial_test. 2022-07-19 16:49:44 -04:00
Nick Mathewson 052f3089ca Bump to rusqlite 0.28. 2022-07-19 16:49:44 -04:00
Nick Mathewson 414939bf8c Merge branch 'mistrust-envvar' into 'main'
Move environment-variable checking into fs-mistrust

Closes #483

See merge request tpo/core/arti!630
2022-07-19 20:46:47 +00:00
Nick Mathewson 6f1de00369 Merge branch 'fallible_writers_v2' into 'main'
Revise tor_bytes::Writer::write to return a Result.

Closes #513

See merge request tpo/core/arti!623
2022-07-19 20:29:15 +00:00
eta b96fcd91f2 Merge branch 'eq' into 'main'
tor-cell: Derive Eq for NtorV3Extension

See merge request tpo/core/arti!631
2022-07-19 19:50:51 +00:00
eta d6b0116b71 Apply 1 suggestion(s) to 1 file(s) 2022-07-19 19:33:15 +00:00
Nick Mathewson d2b64642e1 fs-mistrust: accept "n" as "no". 2022-07-19 15:29:24 -04:00
Ian Jackson d89758ace2 Semver tweaks from review.
These aren't user facing comments, but getting them
right will help us write better changelogs.
2022-07-19 15:29:24 -04:00
Nick Mathewson 222d1fea5e arti-client: Remove code related to overriding fs-mistrust.
This logic can now be adjusted via the config object so that it does
its own overriding by looking at the environment as appropriate.
Removing these methods helps simplify the code a bit.

Enabled by #483.
2022-07-19 15:29:24 -04:00
Nick Mathewson f1d99317bd Arti: Use synthetic argument to implement --disable-fs-permission-checks
Now that configuring the environment variables related to fs
permissions works properly, we don't need to use the "override"
feature any more: we can just add the option to the configuration
when appropriate.

With this design, `--disable-fs-permission-checks` is now mostly an
alias for
`--option storage.permissions.dangerously_trust_everyone=true`

Enabled by #483.
2022-07-19 15:21:09 -04:00
Nick Mathewson 8563635a29 Move responsibility for disable-fs-mistrust envvar.
The variable is now handled when building the configuration, and no
longer needs to be special-cased.

Closes #483.
2022-07-19 15:21:09 -04:00
Nick Mathewson 03b5efbd6e fs-mistrust: API to disable based on environment
By default we look at `$FS_MISTRUST_DISABLE_PERMISSIONS_CHECKS`.

Optionally, the user can provide another variable as well, or
disable looking at the environment entirely.
2022-07-19 15:21:09 -04:00
Ian Jackson 76285d8a2e Merge branch 'dormant' into 'main'
Make dormant be a postage::watch

See merge request tpo/core/arti!632
2022-07-19 18:24:05 +00:00
Ian Jackson 44402f722e tor-basic-utils: Add a test for DropNotifyWatchSender 2022-07-19 19:04:34 +01:00
Ian Jackson c7933de0ab tor-basic-utils: Add ref to upstream issue re drop 2022-07-19 19:00:23 +01:00
Ian Jackson bd41e29f33 tor-basic-utils: Add comment about lack of race
In answer to
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/632#note_2822107

I think this is subtle enough that it deserves a comment.
2022-07-19 17:21:22 +01:00
Yuan Lyu 248e6136bd
Implement ESTABLISH_INTRO relay cell 2022-07-18 21:22:43 -04:00
Ian Jackson cb982183f9 arti-client: Do periodic task dormancy in a management task
This means that it is no longer possible to write code which updates
the dormant mode but forgets to notify the periodic tasks.
2022-07-18 18:13:13 +01:00
Ian Jackson 2d3f4493a4 arti-client: Make dormant_mode be an Option, None on drop
This will allow receivers (which we are about to introduce) to
terminate when the last client is dropped.
2022-07-18 18:13:13 +01:00
Ian Jackson bc498bc7a0 arti-client: Provide DropNotifyWatchSender
There are going to be some tasks (well, right away, one task) which
will want to go away when the sender is dropped.

The docs in postage are silent, but postage::Sender does not
have a Drop impl so I don't think we can rely on the Receivers getting
None from their Stream impl.

So we're going to have the watch send Options, which are None only
when the sender is dropped.
2022-07-18 18:13:13 +01:00