Nick Mathewson
8d9e0eb334
CircMgr: Remove directory liveness testing.
2022-07-26 10:41:38 +01:00
Nick Mathewson
241427ea3f
tor-netdir: Remove latest_netdir method.
2022-07-26 10:41:38 +01:00
Nick Mathewson
1f79e1c49b
Update arti-client to new NetDirProvider API.
...
This allows us to give better errors in the case where bootstrapping
succeeds at first, but fails thereafter for long enough to make our
directory expire.
2022-07-26 10:41:38 +01:00
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
trinity-1686a
61eb0c4f35
use Ed25519 identity instead of PublicKey in tor-cert::rsa
2022-07-25 20:46:01 +02: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
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
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
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
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
Ian Jackson
9146a03533
arti-client: Convert dormant_mode into a postage::watch
...
We are going to want to be able to wake up other tasks elsewhere in
Arti, that need to know about dormancy. We will give them a postage
watch Receiver.
Right now there are no such things yet.
2022-07-18 18:13:13 +01:00
Ian Jackson
9287e009cc
arti-client: Make DormantMode have a Default
2022-07-18 18:13:13 +01:00
Ian Jackson
f8170a9c48
arti-client: Add Bug variant to error
...
We're going to want this in a moment.
2022-07-18 18:13:13 +01:00
Ian Jackson
7acdd21750
Provide maybe_send on postage: ⌚ :Sender, via extension trait
...
We need to replace the AtomicBool for dormant mode with something that
can wake up tasks. postage::watch is the right shape.
But we want to be able to update it but suppress no-op updates.
(There is going to be a call site where no-op updates can occur.)
In the absence of a suitable upstream method as requested here
https://github.com/austinjones/postage-rs/issues/56
we introduce this facility via an extension trait.
2022-07-18 18:13:13 +01:00
Ian Jackson
bcf94f33e0
tor-cell: Derive Eq for NtorV3Extension
...
Apropos clippy complaint.
2022-07-18 17:49:59 +01:00
Nick Mathewson
8d66f8ecd0
Merge branch 'dirmgr_error_cleanup' into 'main'
...
Clean up some errors in tor-dirmgr
Closes #521
See merge request tpo/core/arti!628
2022-07-18 14:40:11 +00:00
Nick Mathewson
3c424c82d7
dirmgr: Add a helper to create LockFile errors.
2022-07-18 10:10:28 -04:00
Ian Jackson
b7de46958d
tor-persist: Resource::Temporary: Mark with cfg
...
Without this, some builds get a "variant is never constructed" warning.
2022-07-18 13:07:30 +01:00
Ian Jackson
44f37b2d07
Merge branch 'cirmgr_error_cleanup' into 'main'
...
Clean-ups in circmgr errors
See merge request tpo/core/arti!625
2022-07-15 15:58:44 +00:00
Nick Mathewson
9d3beb34a3
Bump tor-dirmgr to version 0.5.1.
...
This does not require a change in any other crate, since
the change here does not affect tor-dirmgr's APIs.
2022-07-14 12:00:42 -04:00
Nick Mathewson
c983987782
dirmgr: Make UnrecognizedSchema more helpful
2022-07-14 09:53:17 -04:00
Nick Mathewson
8cbc740d90
dirmgr: Add an instance of BadUtf8InCache
2022-07-14 09:32:01 -04:00
Nick Mathewson
d1e9d4ce84
dirmgr: Clarify disk IO errors.
2022-07-14 09:27:29 -04:00
Nick Mathewson
c1101f13f3
dirmgr: style edits to error messages.
2022-07-14 08:40:42 -04:00
feelingnothing
171dd5eb63
Fix illegal formatting in cache filenames
2022-07-14 15:27:52 +03:00
Ian Jackson
87801dd4c0
Apply 1 suggestion(s) to 1 file(s)
2022-07-13 13:13:13 +00:00
Nick Mathewson
ef76b273a9
circmgr: Refactor DirPathBuilder::pick_path.
...
We no longer needs to have a "return" at the end of each match
block.
2022-07-12 12:05:35 -04:00
Nick Mathewson
c59d6a9211
circmgr: Use FilterCounts to explain why we couldn't build paths
2022-07-12 12:02:12 -04:00
Nick Mathewson
2deb03eb61
circmgr: Use FilterCounts to explain why we couldn't find an exit.
2022-07-12 11:51:05 -04:00
Nick Mathewson
98cda34fb8
netdir: Make pick() functions take FnMut closures.
...
There's no reason to enforce their being Fn closures, and allowing
them to be FnMut allows us to count which filters make us rejected
given relays.
2022-07-12 11:43:49 -04:00
Nick Mathewson
ad87cdcf27
tor-basic-utils: Add a new interface to FilterCount
...
This interface allows using FilterCount with functions that expect
predicates rather than iterator chains.
I'm about to use it to get meaningful FilterCount results in the
path-selection code in circmgr.
2022-07-12 11:35:41 -04:00
Ian Jackson
f098b93d0a
tor-persist: StateMgr: vagueify docs about NoLock error
...
`NoLock` is now a variant of `err::ErrorSource` but that is private.
2022-07-12 15:15:07 +01:00
Ian Jackson
1fc86e3ea9
Fix two rustdoc links
...
This type must have been renamed, I guess.
2022-07-12 15:14:47 +01:00
Nick Mathewson
51f4779f75
tor-circmgr: Clarify and improve Protocol error.
2022-07-12 10:01:56 -04:00
Nick Mathewson
4db7f4b9db
tor-circmgr: minor error message edits.
2022-07-12 09:39:20 -04:00
Nick Mathewson
4dce7557b6
Remove the last vestiges of write_infallible.
...
Now that everything has been converted to fallible writers, we get
to finally remove write_infallible() from tor_bytes.
2022-07-11 11:18:51 -04:00
Nick Mathewson
fbb6484025
tor-proto: Stop using write_infallible in handshake code.
...
This change was a bit annoying, since most of this code _can't_ fail,
and so the only reasonable response is to wrap the input in an
internal error... except for one case where we're actually encoding
a caller-provided message, so we _do_ want to wrap the EncodeError
from tor_bytes.
2022-07-11 11:18:51 -04:00
Nick Mathewson
44314f5076
tor-cell: Stop using write_infallible
...
Also, stop using "expect" and "assert!" to check for errors.
2022-07-11 11:18:51 -04:00
Nick Mathewson
a0a88643f8
tor-cell: Make encoding method signatures fallible.
2022-07-11 11:18:51 -04:00
Nick Mathewson
8ef003c623
tor-linkspec: Stop using infallible writers.
2022-07-11 11:18:51 -04:00
Nick Mathewson
11451235d5
tor-cert: Remove all usage of infallible writers.
2022-07-11 11:18:51 -04:00
Nick Mathewson
2367f92c2c
tor-cert: Encoding now uses Writeable trait.
...
This lets us remove a few TODOs.
2022-07-11 11:18:51 -04:00
Nick Mathewson
9b02cf004c
tor-bytes::impls: Remove usage of infallible writers.
2022-07-11 11:18:51 -04:00
Nick Mathewson
9ca301faee
socksproto: Use fallible writers.
...
Also, make private a function that had formerly been `pub`.
2022-07-11 11:18:51 -04:00
Nick Mathewson
5a61a6d73a
Remove "write_and_consume_infallible".
...
There were only a few of these. Removing it required porting
everything to use `write_and_consume` instead, and handling its
(potential) errors.
2022-07-11 11:18:51 -04:00
Nick Mathewson
8810af7f65
Convert each write_onto_infallible implementation into write_onto.
2022-07-11 11:18:51 -04:00
Nick Mathewson
e1337bee8f
Convert each write_into_infallible implementation into write_into.
...
(There was only one.)
2022-07-11 11:18:51 -04:00
Nick Mathewson
26c81edeea
Define new write_into and write_onto methods with correct APIs.
2022-07-11 11:18:51 -04:00
Nick Mathewson
7938f65c66
Rename "write" methods on tor-bytes to "write_infallible".
...
This comprises four renames:
```
write_onto -> write_onto_infallible
write_into -> write_into_infallible
write -> write_infallible
writer_and_consume -> write_and_consume_infallible.
```
The rest of this branch will be concerned with replacing these
`_infallible` methods with ones that return a `Result`. This is
part of #513 .
2022-07-11 11:18:51 -04:00
Nick Mathewson
fa72365f0e
Add a Bug variant to tor-bytes::EncodeError.
...
This will help down the line as we make more writers fallible.
2022-07-11 11:18:51 -04:00
eta
ea76389c30
Merge branch 'ntor3-high-level' into 'main'
...
Implement a higher-level API for the ntor v3 handshake
See merge request tpo/core/arti!618
2022-07-08 18:07:53 +00:00
eta
af64a0a984
Implement a higher-level API for the ntor v3 handshake
...
This implements a higher-level API for the ntor v3 handshake, in line
with that exposed by the ntor handshake. It does not, however, use the
existing `ClientHandshake` trait, due to fundamental differences in the
handshakes (namely, that the v3 handshake can include some additional
extra extension data).
Currently, the higher-level API assumes circuit extension, and copies
the (undocumented!) magic verification string from c-tor that indicates
this usage.
A rudimentary set of functions for serializing and deserializing
extensions to be sent with the handshake is also included, implementing
the protocol in proposal 332 § A.2. Currently, it only implements the
congestion control extensions specified in proposal 324 § 10.3.
part of arti#88
2022-07-08 18:26:18 +01:00
Nick Mathewson
23d36abadc
Merge branch 'guardmgr-error-cleanup' into 'main'
...
GuardMgr: Improve and revamp error types and messages.
See merge request tpo/core/arti!619
2022-07-08 14:25:41 +00:00
Nick Mathewson
51a59e8c8b
Add a semver note to FilterCount
2022-07-08 09:29:09 -04:00
Nick Mathewson
033a05a9af
Merge branch 'generate_cert' into 'main'
...
Implement functionality to construct signed Ed25519 certs.
Closes #511
See merge request tpo/core/arti!611
2022-07-08 13:25:29 +00:00
Nick Mathewson
82766e74e4
Improve display for tor-dircache errors.
...
These errors no longer use Debug to dump the `Option<SourceInfo>`, but
instead produce reasonable text. Also, I've fixed the SourceInfo
Display implementation so that it now says that it got the error
"from $source via $circuit" rather than the other way around.
2022-07-07 14:07:04 -04:00
Nick Mathewson
d681967b61
dirclient: Generalize MdSha256Empty to EmptyRequest.
...
(It makes sense to use this for things that are not in fact lists of
SHA256 digests of Microdescriptors.)
2022-07-07 14:07:04 -04:00
Nick Mathewson
1735b70769
Note semver break in tor-guardmgr::Error.
2022-07-07 13:20:57 -04:00
Nick Mathewson
3a2631ff9e
Remove now-unused NoGuardsUsable case.
2022-07-07 13:16:06 -04:00
Nick Mathewson
287fe915f9
Improve message for failure to select a guard.
...
This uses similar techniques to the commit I just did for Fallbacks.
2022-07-07 13:16:06 -04:00
Nick Mathewson
d7a626aaa8
Add more information to failed-to-select fallback errors.
...
Also re-order the filters to be a little more logical.
2022-07-07 13:16:06 -04:00
Nick Mathewson
fecc57fbef
FilterCount: Add a simple Display helper.
...
This is a helper rather than a Display implementation because it
isn't the only logical way to display these values. (In fact,
without context, it isn't even the _most_ logical way)
2022-07-06 15:39:30 -04:00
Nick Mathewson
b6e0eea2b0
New "counting filter" iterator helper in tor-basic-utils.
...
This is going to make it simpler to write the code in guardmgr (and
later in circmgr) that keeps track of how many relays were rejected
for what reason. The latter, in turn, should improve error messages
when we're unable to pick a guard or a path.
2022-07-06 15:39:14 -04:00
Nick Mathewson
373b9e2ccf
GuardMgr: tweak an error message.
2022-07-06 15:39:14 -04:00
Ian Jackson
357606a479
Merge branch 'chanmgr-error-cleanup' into 'main'
...
ChanMgr: Add more contextual info to error types.
See merge request tpo/core/arti!616
2022-07-06 17:26:49 +00:00
eta
0537e88d80
Merge branch 'persist-error-cleanup' into 'main'
...
tor-persist: Big refactoring on Error type.
See merge request tpo/core/arti!614
2022-07-06 17:20:43 +00:00
Nick Mathewson
7213c4a45f
Add a semver note.
2022-07-06 11:51:28 -04:00
Nick Mathewson
dd491931c8
ChanMgr: errors: attribute errors to correct address.
...
Even when keys are relevant, we still don't want to attribute errors
to a set of addresses when we have a single address that we're
connected with.
2022-07-06 11:51:28 -04:00
Nick Mathewson
bc9db9b84c
ChanMgr: Add more contextual info to error types.
...
Now each type has a peer. In some cases this peer is just an
address, whereas in others (where key is relevant or address isn't
yet narrowed down) it's a full OwnedChanTarget.
2022-07-06 11:51:28 -04:00
Nick Mathewson
853aed6859
tor-persist: Big refactoring on Error type.
...
Every error now has an action (what we were trying to do), a
resource (what we were trying to do it to), and a source (what
problem we encountered).
Initially I tried to add "action" and "resource" fields to error
variants individually, but that led to a combinatorial explosion.
Part of #323 .
2022-07-06 11:47:17 -04:00
Nick Mathewson
48e44b0140
Implement functionality to construct signed Ed25519 certs.
...
This is behind a feature flag, since it isn't needed for pure
clients: only onion services and relays need this.
I've named the object that constructs these certs
`Ed25519CertConstructor` because it doesn't follow the builder
pattern exactly: mainly because you can't get an Ed25519Cert out of
it. _That_ part is necessary because we require that an Ed25519Cert
should only exist if the certificate was found to be well-signed
with the right public key.
Closes #511 .
2022-07-06 11:11:04 -04:00
Nick Mathewson
56fefd7adf
tor-llcrypto: expose the Signer API from ed25519-dalek
2022-07-06 11:11:04 -04:00
Ian Jackson
6878e3a2d4
Merge branch 'update-rsa-v2' into 'main'
...
Update `rsa` dependency (and use `x25519-dalek` prerelease)
Closes #448
See merge request tpo/core/arti!612
2022-07-06 14:42:26 +00:00
eta
c2e2da5dc3
Update `rsa` dependency (and use `x25519-dalek` prerelease)
...
- arti#448 and arti!607 highlight an issue with upgrading `rsa`: namely,
the `x25519-dalek` version previously used has a hard dependency on
`zeroize` 1.3, which creates a dependency conflict.
- However, `x25519-dalek` version `2.0.0-pre.1` relaxes this dependency.
Reviewing the changelogs, it doesn't look like that version is
substantially different from the current one at all, so it should be
safe to use despite the "prerelease" tag.
- The new `x25519-dalek` version also bumps `rand_core`, which means we
don't have to use the RNG compat wrapper in `tor-llcrypto` as much.
closes arti#448
2022-07-06 14:57:45 +01:00
Ian Jackson
9318e8712a
Fix clippy needless deref
2022-07-06 12:05:57 +01:00
Ian Jackson
8f63c07b5f
tor-netdoc: b64 tests: add exhaustive roundtrip test
2022-07-06 12:04:23 +01:00
Nick Mathewson
aeef36a538
tor-persist: Move Error to a module.
2022-07-06 11:38:10 +01:00
spongechameleon
1242925e68
Add unit tests for arti-hyper's uri -> host,port,tls conversion
2022-07-05 13:45:41 -06:00
Ian Jackson
a63d540d68
Merge branch 'bump-base64ct' into 'main'
...
Bump `base64ct` crate `1.5.0` -> `1.5.1`
See merge request tpo/core/arti!608
2022-07-05 13:36:48 +00:00
Nick Mathewson
56f931e8e1
Merge remote-tracking branch 'origin/mr/610'
2022-07-05 09:10:10 -04:00
Richard Pospesel
61119d5004
Fixed typo in convert_curve25519_to_ed25519_private comments
2022-06-29 16:52:59 +00:00
Dimitris Apostolou
e5175a2178
Fix typo
2022-06-28 14:40:25 +03:00
Arturo Marquez
af4970ec1f
Bump `base64ct` crate `1.5.0` -> `1.5.1`
...
This new release checks for invalid symbols in non-padded inputs
for decoding. Therefore, we can get rid of the logic implemented
in `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600 `
2022-06-27 23:10:58 -05:00
Nick Mathewson
1dda69af2b
Remove semver.md files now that 0.5.0 is out
2022-06-24 13:31:38 -04:00
Nick Mathewson
20435aea75
Bump crate and dependency versions.
...
These were done with the following commands:
```
cargo set-version -p tor-basic-utils --bump patch
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p tor-error --bump patch
cargo set-version -p tor-config --bump patch
cargo set-version -p tor-units --bump patch
cargo set-version -p tor-rtcompat --bump minor
cargo set-version -p tor-llcrypto --bump patch
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-proto --bump minor
cargo set-version -p tor-netdoc --bump patch
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-persist --bump patch
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump patch
cargo set-version -p tor-dirclient --bump patch
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p arti-client --bump patch
cargo set-version -p arti --bump minor
cargo set-version -p arti-bench --bump minor
cargo set-version -p arti-testing --bump minor
```
2022-06-24 12:00:22 -04:00
Nick Mathewson
d5170d5318
Increment versions of crates with trivial changes only.
...
"Trivial" here includes stuff like cargo reformatting, comment
edits, error message string changes, and clippy warning changes.
Crates that depend on these do not need to increment.
2022-06-24 11:43:02 -04:00
Ian Jackson
4831f9d38c
Merge branch 'clippy' into 'main'
...
Fix clippy nightly again
See merge request tpo/core/arti!603
2022-06-24 14:13:58 +00:00
Nick Mathewson
1f8f24dbcb
Merge branch 'dirmgr' into 'main'
...
dirmgr: followups to !587 , mostly using iterators
Closes #468
See merge request tpo/core/arti!599
2022-06-24 13:46:52 +00:00
Ian Jackson
23c352b96b
clippy: Consolidate many lints in maint/add_warning
...
Found these by disabling the nightly dbg macro special case. Now, we
have a mechanism for globally adding suppressions to tests, we can use
that instead.
2022-06-24 14:23:38 +01:00
Ian Jackson
d965dc3f70
clippy: Add standard test lint block to several examples
2022-06-24 14:23:38 +01:00
Ian Jackson
bebf013bef
maint/add_warning: Add two lints via add_warning as a test case
2022-06-24 14:23:38 +01:00
Ian Jackson
72515abf91
maint/add_warning: Add ability maintain test lint blocks
2022-06-24 14:23:38 +01:00
eta
ec3e1f2ada
Merge branch 'error_cleanup_2' into 'main'
...
Error refactoring: bytes, cert, proto.
See merge request tpo/core/arti!604
2022-06-24 13:01:42 +00:00
Nick Mathewson
ea3160737c
Fix a couple of typos in rustdoc comments.
2022-06-24 08:18:15 -04:00
Nick Mathewson
ce4d062c09
Update README.md files from rustdoc.
2022-06-24 08:02:56 -04:00
Nick Mathewson
38004a4f4d
tor-proto: split and elaborate tor_bytes::Error instances
...
Some of these were for decoding particular objects (we now say
what kind of objects), and some were unrelated tor_cert errors that
for some reason we had shoved into a tor_bytes::Error.
There is now a separate tor_cert::CertError type, independent from
tor_cert's use of `tor_bytes::Error` for parsing errors.
2022-06-23 15:42:45 -04:00
Nick Mathewson
35b7b8a47a
tor-proto: Split CellErr based on activity.
...
Failing to encode is fundamentally different from failing to
decode. We now treat those separately, and describe _what_ we failed
to encode or decode.
2022-06-23 14:59:52 -04:00
Ian Jackson
b1aab512ff
Merge branch 'tor-netdoc/use-base64ct' into 'main'
...
Replace `base64` crate with `base64ct` crate in `tor-netdoc`
See merge request tpo/core/arti!600
2022-06-23 18:52:14 +00:00
Nick Mathewson
92fd9fb0de
tor-proto: clean up error names and messages
...
This avoids adding additional information for now; that will come on
the next commits.
2022-06-23 14:35:26 -04:00
Ian Jackson
2ed2fc4ac7
base64: Move some tests into a separate function, placating clippy
2022-06-23 19:21:55 +01:00
Ian Jackson
589c6e52bb
Run maint/add_warning crates/*/src/{lib,main}.rs
...
Update all lint blocks
2022-06-23 19:15:42 +01:00
Ian Jackson
6c110a232c
dirmgr: Use ... .find().is_none() rather than clippy's suggestion
2022-06-23 18:42:33 +01:00
Ian Jackson
20e41c30fe
base64: Add yet more test cases
2022-06-23 18:32:58 +01:00
Nick Mathewson
f699988c41
tor-bytes: Split EncodeError from Error
...
Since there is currently only one error type that can occur when
encoding, it doesn't make sense to use the full Error type here.
This split will help us downstream, as we no longer need to
categorize tor_bytes::Error as "an error in encoding or decoding".
I considered renaming Error to DecodeError, but that had pretty huge
downstream effects, and didn't seem to be worth it.
2022-06-23 08:58:25 -04:00
Nick Mathewson
210f3f1587
Merge branch 'error_cleanup' into 'main'
...
Error cleanup, part 1
See merge request tpo/core/arti!601
2022-06-22 19:43:50 +00:00
Nick Mathewson
813a648ce2
fs-mistrust: convert Io error variant to a struct.
2022-06-22 15:21:34 -04:00
Nick Mathewson
0369995364
tor-cell: convert BytesErr to a struct variant
2022-06-22 15:21:12 -04:00
Arturo Marquez
b72bf50698
Add some more test cases for base64
...
These tests are borrowed from other parts of the `tor-netdoc`
crate.
2022-06-22 11:30:57 -05:00
Arturo Marquez
87ed48271a
Improve base64 tests
...
Request for changes: `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600#note_2816252 `
2022-06-22 10:34:01 -05:00
Arturo Marquez
4333708384
Add link to upstream issue
...
As per request, here: `https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/600#note_2816252 `
2022-06-22 09:55:11 -05:00
Nick Mathewson
c3da82fc2d
tor-cell: error usefulness and style fixes
2022-06-22 10:02:42 -04:00
Nick Mathewson
e3e922d03f
Improve error messages in tor-checkable.
2022-06-22 09:48:42 -04:00
Nick Mathewson
5577163387
tor-socksproto: Style and info fixes in errors.
...
(The use of Cow<> in the error message isn't strictly necessary
here, but it's a pattern I want to encourage.)
2022-06-22 09:16:44 -04:00
Nick Mathewson
3120f1092a
Style fixes to tor-bytes errors.
...
Also note an issue with the design of tor-bytes::Error that should
probably go in a separate MR.
2022-06-22 09:00:59 -04:00
Nick Mathewson
7163b7dcc0
Style fixes to tor-protover errors.
2022-06-22 08:50:44 -04:00
Nick Mathewson
f6d6ac7fe9
tor-llcrypto: style fixes on BlindingError
2022-06-22 08:47:18 -04:00
Nick Mathewson
9ba7750dfe
Style fixes to tor-units errors.
2022-06-22 08:42:13 -04:00
Nick Mathewson
bf2336e547
Style fixes to tor-events errors.
2022-06-22 08:39:44 -04:00
Nick Mathewson
c39631af27
tor-config: style fixes on CfgPathError.
2022-06-22 08:36:13 -04:00
Nick Mathewson
37cbd38abc
tor-config: Don't format source error as part of error message
...
This is one I missed earlier.
2022-06-22 08:23:33 -04:00
Nick Mathewson
48653df68f
Style fixes to retry-error error messages.
2022-06-22 08:11:44 -04:00
Nick Mathewson
9102948045
Style fixes to safelog errors.
2022-06-22 08:07:37 -04:00
Nick Mathewson
326ab1a7ae
Editorial improvements on fs-mistrust errors
...
These changes make sure that the errors conform to our preferred
style, and include a description of what exactly we were doing when
something went wrong.
2022-06-22 08:03:15 -04:00
Ian Jackson
d2bd71c5f0
dirmgr: DirBootstrapStatus: Refactor mut_status_for using entries_mut
...
IMO this is rather less confusing.
2022-06-22 10:53:02 +01:00
Ian Jackson
d36c433b36
dirmgr: Use new statuses() helper method
...
The two call sites become clearer, IMO.
2022-06-22 10:53:02 +01:00
Ian Jackson
24d43f83fd
dirmgr: DirBootstrapStatus: Provide statuses and entries_mut
...
We're going to use these in a moment.
One returns entries and the other statuses simply because that's
what's actually going to be wanted.
2022-06-22 10:53:02 +01:00
Ian Jackson
5c51d03efb
dirmgr: Remove a TODO comment
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/587#note_2815945
2022-06-22 10:53:02 +01:00
Arturo Marquez
2d92e9e218
Remove unused `base64` crate
2022-06-21 20:28:58 -05:00
Arturo Marquez
6536ca0f61
Replace `base64` crate with `base64ct` crate
...
Note: the `base64ct` crate rejects invalid characters when the
decoding is done on padded strings. However, the `FromStr` impl
for `B64` can have both padded **and** unpadded inputs, so all
inputs are now padded first, before decoding.
2022-06-21 20:02:33 -05:00
eta
4e3537746f
Merge branch 'display_source_cleanup' into 'main'
...
Do not include error source() in display() format.
See merge request tpo/core/arti!598
2022-06-21 19:34:27 +00:00
Ian Jackson
9b4ba4893e
Merge branch 'stalled_directory' into 'main'
...
Detect and report stalled directory downloads
Closes #468
See merge request tpo/core/arti!587
2022-06-21 19:13:40 +00:00
Ian Jackson
da2e53bf76
tor-chanmgr: Change to use unwrap_void
...
As per discussion in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813573
2022-06-21 19:19:28 +01:00
Ian Jackson
a2614729a4
channel padding: Rename ChannelsParams from ChannelsConfig (rustfmt)
...
Consequential ordering changes.
2022-06-21 19:19:28 +01:00
Ian Jackson
7d676cde02
channel padding: Rename ChannelsParams from ChannelsConfig
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2814276
Change names and comments and docs everywhere.
2022-06-21 19:19:28 +01:00
Ian Jackson
ff228e5d9c
channel padding: chanmgr: Clarify a comment
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813574
2022-06-21 19:19:28 +01:00
Ian Jackson
65e6683b0b
tor-proto: Have Channel::reconfigure throw ChannelClosed
...
Addresses
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813567
2022-06-21 19:19:28 +01:00
Ian Jackson
13ca24ba3a
tor-proto: err: Provide ChannelClosed as a separate unit error
2022-06-21 19:19:28 +01:00
Ian Jackson
19c52ff8e4
channel padding: Use IntegerMilliseconds in netdir
2022-06-21 19:19:28 +01:00
Ian Jackson
db71018021
tor-netdir: Make CHANNEL_PADDING_TIMEOUT_UPPER_BOUND pub
...
We need this because it is a type parameter for the types of nf_ito_*.
2022-06-21 19:19:28 +01:00
Ian Jackson
9779e5a2e2
channel padding: Use IntegerMilliseconds in padding::Parameters
2022-06-21 19:19:28 +01:00
Ian Jackson
b1b840c7c6
tor-units: IntegerTimeUnit: Provide try_map
...
This lets a caller map the inner value, eg to convert the type.
I don't provide `map` as well as `try_map` now, since I don't need it;
we could add it later if it is desirable (although try_map can always
be used instead).
I was hoping to provide a `TryFrom` instead, but that necesasrily
overlaps with the std conversion impl from IntegerMilliseconds<T> to
IntegerMilliseconds<U> where T == U.
2022-06-21 19:19:22 +01:00
Ian Jackson
0ea34e3280
tor-units: IntegerTimeUnit: Relax condition on T
...
It is semantically quite meaningful for these to contain something
that isn't `TryInto<u64>`. (Of course the `Duration` conversion won't
work without that.)
Indeed, this condition was only applied to two out of the three types.
Prompted by being near this code, but not actually necessary for
anything I'm doing here.
2022-06-21 19:19:22 +01:00
Ian Jackson
ec756c79e7
tor-units: IntegerTimeUnit: Provide as_time_unit deconstructor
...
We're going to need this to use this in the padding timer parameters.
2022-06-21 19:19:22 +01:00
Ian Jackson
db4e5aba97
channel padding parameters update: Drop a redundant clone
2022-06-21 19:19:22 +01:00
Ian Jackson
a5aaa56c3c
channel padding: Change timeout to match C Tor
...
Pending an official value from the spec.
2022-06-21 19:19:22 +01:00
Ian Jackson
2d97ab3677
Fix docs for `CtrlMsg::ConfigUpdate`
...
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813565
2022-06-21 19:19:22 +01:00
eta
54c7070b30
Fix typos
2022-06-21 19:19:22 +01:00
Ian Jackson
d2b783641d
channel padding: Test timeout updates
2022-06-21 19:19:22 +01:00
Ian Jackson
e0040701d0
tor-chanmgr tests: Add config_update tracking to FakeChannel
2022-06-21 19:19:22 +01:00
Ian Jackson
6e07401e6b
channel padding: Honour NetDir for timeouts
...
But padding is still not enabled by default.
2022-06-21 19:19:22 +01:00
Ian Jackson
e53555f418
channel padding: Add the parameters from the spec to NetDir
2022-06-21 19:19:22 +01:00
Ian Jackson
7f3f426738
channel padding: Plumb settings from chanmgr
2022-06-21 19:19:22 +01:00
Ian Jackson
b5218a0c0e
channel padding: Introduce ChannelsConfig and reconfigure facility
...
Nothing geenrates config updates yet.
2022-06-21 19:19:22 +01:00
Ian Jackson
33ef338fe2
chanmgr: inner (map): Reorganise to prepare for having more state
...
The main copy of the (global) configuration for the client's channels
is going to have to live here, inside this mutex. So this really
needs to become a struct with names fields.
2022-06-21 19:19:22 +01:00
Ian Jackson
09b40d7d81
channel padding timer: Support reconfiguration
...
Nothing calls this yet.
2022-06-21 19:19:22 +01:00
Ian Jackson
e5f3215b95
channel padding timer: Allow creation without providing parameters yet
...
It turns out that we are going to want this.
2022-06-21 19:19:22 +01:00
Ian Jackson
f9414a29b2
channel padding: Test creation in disabled state
...
We're about to split the main new() function off so write a separate
test for new_disabled().
2022-06-21 19:19:22 +01:00
Ian Jackson
7135b7c4c7
channel padding: Make Parameters a pub struct with builder
...
chanmgr is going to want to make one of these from a NetDir.
2022-06-21 19:19:22 +01:00
Ian Jackson
db4ea619f5
tor-chanmgr: tests: Have unwrap_open return a (mut) reference
...
This avoids confusing bugs where you try to modify the result and
nothing happens!
2022-06-21 19:19:22 +01:00
Nick Mathewson
08d9bbf33b
Do not include error source() in display() format.
...
According to doc/Errors.md, and in keeping with current best
practices, we should not include display an error's `source()` as
part of that error's display method. Instead, we should let the
caller decide to call source() and display that error in turn.
Part of #323 .
2022-06-21 14:14:14 -04:00
Nick Mathewson
9b7849a293
Refactor DirStatus data structures.
...
AttemptId is now linked to DirStatus in StatusEntry.
DirBootstrapStatus now has an inner enum to make invalid status
unrepresentable.
2022-06-21 10:26:53 -04:00
0x4ndy
3175d96236
Updated the warning message providing additional information about the type of the proxy port.
2022-06-21 12:47:46 +00:00
Ian Jackson
a3d8a425c4
Merge branch 'ring_out_the_old' into 'main'
...
Enforce no-ring-in-arti/full (and make it true)
See merge request tpo/core/arti!592
2022-06-17 13:42:38 +00:00
Nick Mathewson
9ae57e8bc4
Merge branch 'reachable_addrs_v2' into 'main'
...
Implement support for reachable_addrs
Closes #491 and #93
See merge request tpo/core/arti!583
2022-06-17 13:16:16 +00:00
Nick Mathewson
f4c9b9cc1e
Rename guardset-selection function.
...
Also, improve its documentation.
2022-06-17 08:47:57 -04:00
Nick Mathewson
03568cd4a5
Rename pick_guard, pick_guard_ext.
...
Now the primary exposed function is `pick_guard` again.
This commit is just function renaming.
2022-06-17 08:47:57 -04:00
Nick Mathewson
1be44891c9
Refactor and document issues with modify_hop.
...
At the site of modify_hop, we now have a comment explaining the
internal-error issue.
To make the internal error less likely, we lower the modify_hop call
in lib.rs into GuardSet, where it can make sure it's looking at the
same filter as was used to select the guard.
The function name "pick_guard_ext" is not permanent; I'm going to
rename it in the next commit.
2022-06-17 08:47:57 -04:00
Nick Mathewson
96dfa97473
API-fix for extend_sample_as_needed.
...
Previously, the API said "you need to call this in a loop till it
returns false". We did that in one place, but not another.
With the introduction of filters, forgetting to loop here becomes a
bug: so instead, change the behavior of extend_sample_as_needed so
it handles looping itself.
2022-06-17 08:47:57 -04:00
Nick Mathewson
a92dfa0b2a
Remove some outdated comments.
...
These all say, in one form or another, "there is no guard filtering;
there is only one selection". That's now false.
2022-06-17 08:47:57 -04:00
Nick Mathewson
89f9e1decb
Tweak parameters in guardmgr tests to improve testnet behavior.
...
The fake network we construct for these tests is small in ways that
can sometimes cause weird behavior with guard filters. We fix this
by adjusting the parameters of the guard selection algorithm
accordingly in the tests.
With these new parameters, #491 no longer occurs.
This commit also adds comments to explain why the parameters are set
as they are.
Closes #491 .
2022-06-17 08:47:57 -04:00
Nick Mathewson
34e8e208cc
CircMgr: Enable reachable_addrs filter.
2022-06-17 08:47:57 -04:00
Nick Mathewson
1c5f540dc8
Add a configuration option for reachable_addrs
...
(This doesn't do anything yet.)
2022-06-17 08:47:57 -04:00
Nick Mathewson
fb672dc688
NetDoc: Make AddrPortPattern implement serde traits
...
I'm using serde_with here to just re-use the Display and FromStr
implementations, since those are what has proven easier to type in
the past.
2022-06-17 08:47:57 -04:00
Nick Mathewson
48a86506be
GuardMgr: Support for multiple guard sets
...
guard-spec.txt specifies that we have multiple separate samples of
guards that we can use depending on whether the filter is
restrictive or not. Here we implement the rules for switching
between samples.
2022-06-17 08:47:57 -04:00
Nick Mathewson
e098a5a303
Move set_filter into GuardMgrInner.
...
Convert its argument type to Option<&NetDir> to better match the
rest of the API.
2022-06-17 08:47:57 -04:00
Nick Mathewson
a720f4f667
GuardMgr: Function to tell how permissive a filter is.
...
When we're filtering guards, we have to check whether the filter is
"restrictive": if it forbids most of the guards (by bandwidth), we
keep its guards separated from the main set. If it is
super-restrictive, we also warn.
This functionality is specified in guard-spec.txt.
2022-06-17 08:47:57 -04:00
Nick Mathewson
19fa946fc7
Make AddrPortPattern and friends implement Eq and PartialEq
2022-06-17 08:46:16 -04:00
Nick Mathewson
e3c2a86195
GuardMgr: Also apply filters to fallback directories.
2022-06-17 08:46:16 -04:00
Nick Mathewson
a189aaf1fb
GuardMgr: remove disallowed addresses from returned FirstHops.
...
Since a guard can have a bunch of addresses, and the guard is
permitted if any one of those addresses is permitted, then we might
decide to use a guard with some non-permitted addresses. Thus, we
need to filter those addresses before returning the view of the
guard as a FirstHop.
2022-06-17 08:46:16 -04:00
Nick Mathewson
23218fe037
GuardMgr: Remove old testing filter variant.
...
We don't need to restrict based on bits in the key id any longer,
since we have a real filter.
2022-06-17 08:46:16 -04:00
Nick Mathewson
9c4f31edc1
GuardMgr: Add a new filter type based on reachable addresses.
2022-06-17 08:46:16 -04:00
Nick Mathewson
801b6bec5f
Guardmgr: Change the GuardFilter API.
...
The guard filter is now a set of restrictions that can be placed on
allowable guards.
2022-06-17 08:46:16 -04:00
Nick Mathewson
5509bd0269
Merge branch 'config-fix2' into 'main'
...
Use impl_standard_builder more and remove manual Default/builder impls
See merge request tpo/core/arti!594
2022-06-16 20:30:34 +00:00
Ian Jackson
44659ebb8b
tor-proto: channel: Tell clippy it's ok to print in tests
2022-06-16 19:33:32 +01:00
Ian Jackson
61bd8b810a
Merge branch 'upgrade_float_eq' into 'main'
...
Upgrade to float_eq 1.0.0
See merge request tpo/core/arti!591
2022-06-16 17:26:04 +00:00
Ian Jackson
db51bdcbc1
Merge branch 'config-fix' into 'main'
...
Config handling and logging fixes
Closes #480
See merge request tpo/core/arti!589
2022-06-16 15:46:18 +00:00
Ian Jackson
ed62a575d3
arti: cfg: Remove another needless borrow
2022-06-16 16:08:10 +01:00
Ian Jackson
2ca2c03059
impl_standard_builder: Use for tor_dirmgr::Authority
2022-06-16 15:42:06 +01:00
Ian Jackson
e004316942
impl_standard_builder: Use for tor_guardmgr::FallbackDir
2022-06-16 15:42:06 +01:00
Ian Jackson
17caebd284
impl_standard_builder: Use for tor_dirmgr::DownloadSchedule
2022-06-16 15:42:06 +01:00
Ian Jackson
c466f13ce3
impl_standard_builder: Use for arti::logging::LogfileConfig
2022-06-16 15:42:06 +01:00
Ian Jackson
90ba8b15de
impl_standard_builder: Allow for !Default
2022-06-16 15:42:06 +01:00
Ian Jackson
c5bbaf470a
arti: logging config: Replace a manual Debug impl
2022-06-16 15:27:00 +01:00
Ian Jackson
8b724d40f8
impl_standard_builder: Use for tor_dirmgr::DownloadScheduleConfig
2022-06-16 15:27:00 +01:00
Ian Jackson
2ab5c0861e
impl_standard_builder: Use for tor_dirmgr::NetworkConfig
2022-06-16 15:27:00 +01:00
Ian Jackson
e32210a398
impl_standard_builder: Use for tor_dirmgr::DirSkewTolerance
2022-06-16 15:27:00 +01:00
Ian Jackson
c895057cb9
tor-config: impl_standard_builder: handle contexts with local Result
2022-06-16 15:27:00 +01:00
Ian Jackson
fc3f36e9c9
arti cfg tests: Remove a redundant line that shadows an earlier binding
...
Prompted by review
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/589#note_2813596
2022-06-16 14:34:43 +01:00
eta
ed3baea683
Fix grammar error
2022-06-16 14:34:43 +01:00
Ian Jackson
a0935ca6ee
arti: Enable some pre-config logging
2022-06-16 14:34:43 +01:00
Ian Jackson
d57fc34841
arti: Introduce closure which will be used for pre-config logging
...
Right now this is an IEFI and therefore a no-op.
2022-06-16 14:34:43 +01:00
Ian Jackson
1332e02b61
arti cfg tests: Test that example config works as-is
...
It contains only sections, but we want to detect when that is a problem!
2022-06-16 14:34:43 +01:00
Ian Jackson
0ab60d832a
arti: cfg tests: Refactor to prepare for new test
...
We're going to call this new closure another time.
2022-06-16 14:34:43 +01:00
Nick Mathewson
c4a9c8a1c4
Merge branch 'main' into 'accel-features'
...
# Conflicts:
# crates/arti-client/Cargo.toml
2022-06-16 13:24:46 +00:00
Nick Mathewson
19679a6f13
Remove rustls from tor-rtcompat/full
...
This is another consequence of the `ring` license issue; see #493 .
2022-06-16 08:45:10 -04:00
Nick Mathewson
519f7dfa88
Upgrade to float_eq 1.0.0
2022-06-16 08:39:03 -04:00
Nick Mathewson
0223c91b26
Merge branch 'high-level-features' into 'main'
...
Add "full" and "experimental" features to arti, arti-client, and below.
Closes #499
See merge request tpo/core/arti!584
2022-06-16 12:24:47 +00:00
Ian Jackson
4c65e9994d
Add some missing `serde(default)` to uses of humantime_serde::option
...
Without this, if the substructure is provided, these fields are
mandatory within it.
2022-06-16 11:08:16 +01:00
Nick Mathewson
28a23e96bd
Remove "rustls" from "full", for license reasons.
...
Rustls uses ring, which uses code from BoringSSL, which derived from
OpenSSL before OpenSSL changed their license. So ring is currently
under 3BSD/SSLEay licenses, which aren't GPL-compatible, which may
be a problem for some people.
See #493 .
2022-06-15 13:45:38 -04:00
Nick Mathewson
5e05573ec9
Merge branch 'clippy_20220614' into 'main'
...
Fix several clippy issues, most with nightly
See merge request tpo/core/arti!588
2022-06-15 17:34:53 +00:00
Nick Mathewson
bd9bd39ef3
Add one more "allow" to tor_netdoc::parse::macros.
...
Without this, clippy is error-free, but `cargo test` somehow gives a
warning.
2022-06-15 11:52:30 -04:00
Nick Mathewson
2f0bef64a3
Permit eprintln in channel-padding test.
...
There is not, apparently, an eprintln equivalent for
allow-dbg-in-tests.
2022-06-15 11:52:30 -04:00
Nick Mathewson
647d4410bb
Fix clippy::significant_drop_in_scrutinee warnings
...
This is apparently a new warning from clippy nightly, documented in
https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee .
I'm not in love with the temporary variables that this warning wants
me to introduce, but it does seem like a decent way to avoid some
kinds of deadlock.
2022-06-15 11:52:30 -04:00
Nick Mathewson
425af9db91
Work around an erroneous warning from nightly clippy
2022-06-15 11:52:30 -04:00
Nick Mathewson
331578d19c
Make display formats work with older derive_more.
2022-06-14 14:10:18 -04:00
Nick Mathewson
c74c268c8b
tor-dirmgr: Make DirStatus non-public.
...
I believe this type was made public in error: No other crate uses it,
and no API exposes it.
2022-06-14 11:02:29 -04:00
Nick Mathewson
bdcbf1982a
Report directory blockage problems from arti-client.
...
Closes #468 .
2022-06-14 10:51:04 -04:00
Nick Mathewson
e3dced360b
Add a blockage-reporting mechanism to tor-dirmgr.
...
The `DirBootstrapStatus` type now exposes a blockage() method to
return an `Option<DirBlockage>`.
The blockage types reported are more low-level than I'd like, but
they are IMO good enough for now: we'll want to get experience with
actual vs hypothetical problems before we refine them.
2022-06-14 10:42:18 -04:00
Nick Mathewson
25bbdd5f25
Add a couple of TODO items.
2022-06-14 10:05:27 -04:00
Nick Mathewson
660b3104a9
Do not update_progress on load if nothing happened.
...
If there was no partial information, then calling update_progress
will now report a stall in this case, which is not what we want.
2022-06-14 09:58:58 -04:00
Nick Mathewson
13c152d2ac
DirMgr: Track errors, stalls, and resets as part of status.
...
A "reset" happens whenever we have to start a download attempt over
-- either because we ran out of retries, or we found something wrong
with the consensus after fetching certificates.
An "error" happens when we have a recoverable error from one or more
directory sources.
A "stall" happens whenever a round of downloads or cache loads leads
to no change in the status.
We don't yet use this as part of our status reporting.
2022-06-13 13:58:31 -04:00
Nick Mathewson
2a2afaa7c2
Refactor our logic for distinguishing download attempts
...
Previously we used the "if-modified-since" time associated with the
consensus download, and/or the "valid-after" time in the consensus
attempt, to put multiple attempts into sequence, and to tell one
from another. But that approach was always a kludge, and will soon
get more unreliable as the DirStatus logic gets a bit more complex.
With this commit, we change separate download attempts to be
identified with an AttemptId that increments whenever we decide to
get a different directory from the one we have. IMO this new code
is _much_ cleaner.
2022-06-13 13:21:09 -04:00
Nick Mathewson
68ea880b84
Refactor most DirStatus users to use DirProgress.
...
This is all crate-internal APIs, fortunately.
2022-06-13 12:22:04 -04:00
Nick Mathewson
238f2b5637
Move `at_least_as_new_as` to DirProgress.
2022-06-13 12:02:30 -04:00
Nick Mathewson
6c9d30681f
Turn the DirProgress in DirStatus into a named field.
2022-06-13 10:53:46 -04:00
Nick Mathewson
f581feb0ac
Rename DirStatusInner to DirProgress.
...
This is about to become only a _part_ of what defines a DirStatus: a
DirStatus will also include a reset count, and some kind of info
about how long we've gone without progress.
2022-06-13 10:49:09 -04:00
Nick Mathewson
2d39545f8d
Merge branch 'unwrap' into 'main'
...
tor-netdir: testnet: Make construct_netdir infallible
See merge request tpo/core/arti!585
2022-06-13 14:37:08 +00:00
Nick Mathewson
10b38a7d7c
Add "accel-*" features to arti-client and arti.
...
These need to be optional: they improve performance by shifting to
asm implementations, which may not be everybody's idea of good practice.
These are not 'pure' features, since they select one implementation
but disable another. Therefore they don't go in `full`.
Closes #441 .
2022-06-13 10:22:24 -04:00
Nick Mathewson
3673409735
Add a feature to tor-llcrypto to enable sha-1/asm.
...
SHA1 is a reasonably large part of our CPU usage (sigh), and this
implementation is 20-50% faster, depending on arch.
2022-06-13 10:13:13 -04:00
Nick Mathewson
d44dd6f44f
Merge branch 'dormant_directory' into 'main'
...
Use TaskSchedule to sleep in directory bootstrapping
Closes #497
See merge request tpo/core/arti!571
2022-06-13 13:59:26 +00:00
Ian Jackson
3e035927f2
tor-netdir: testnet: Make construct_netdir infallible (rustfmt)
...
Run rustfmt. Separate commit to make review of the substantive commit
easier.
2022-06-13 14:26:32 +01:00
Ian Jackson
7d223ac9e6
tor-netdir: testnet: Make construct_netdir infallible
...
This is a *lot* of unwraps. The function takes no parameters and
is used only for testing. It ought to be infallible.
2022-06-13 14:25:45 +01:00
Nick Mathewson
923a7c55e3
Document "full", "experimental" in toplevel crate documentation.
...
Also, unify the features documentation format for those two crates,
and document previously undocumented features there.
2022-06-13 09:04:02 -04:00
eta
f7a9274e57
Merge branch 'option' into 'main'
...
config: Be consistent about Option
Closes #488
See merge request tpo/core/arti!582
2022-06-13 12:30:03 +00:00
eta
ca38fbeaaf
Merge branch 'doc' into 'main'
...
tor-error: Fix a broken intra-doc link
See merge request tpo/core/arti!580
2022-06-13 12:29:29 +00:00
Nick Mathewson
2129aee6cd
DirMgr: Use scopeguard crate in place of ad hoc RAII substitutes
2022-06-13 08:28:41 -04:00
Nick Mathewson
a7b406e69f
Put the task schedule back when the dl task exits.
...
This will allow somebody else to call bootstrap() if bootstrap() fails
the first time.
2022-06-13 08:28:41 -04:00
Nick Mathewson
430f4ffb86
New API to expose and use TaskHandle from DirMgr.
...
This change also means that we need to create the handle and scheduler
earlier in the process of creating the DirMgr. If we don't, we won't
have a way to manage the task before bootstrap() returns.
2022-06-13 08:28:41 -04:00
Nick Mathewson
ef4364f465
Add "full" and "experimental" features to arti.
2022-06-10 15:35:00 -04:00
Nick Mathewson
8a586a40fa
Add "full" and "experimental" features to arti-client and below.
...
The "full" feature is a catch-all for all features, _except_:
* Those that select a particular implementation (like
tor-llcrypto/with-openssl) or build flag (like "static")
* Those that are experimental or unstable (like "experimental-api")
* Those that are testing-only.
2022-06-10 15:32:21 -04:00
Nick Mathewson
171b406b00
DirMgr: Refactor bootstrap to use a TaskSchedule for sleeping.
...
This change (not yet exposed as an API) will let the TorClient have
a `TaskHandle` corresponding to the directory task, letting it
make the directory task dormant as needed.
2022-06-10 13:59:30 -04:00
Nick Mathewson
947bbe6fe7
TaskSchedule: Add a sleep_until_wallclock method too.
2022-06-10 13:59:30 -04:00
Nick Mathewson
e7681ca135
Merge branch 'nested-read-write' into 'main'
...
tor-bytes: read_nested_*: Take a closure
Closes #498
See merge request tpo/core/arti!579
2022-06-10 14:27:08 +00:00
Nick Mathewson
4f6c4f91c9
Merge branch 'channel' into 'main'
...
Have channel reactor able to send channel padding
See merge request tpo/core/arti!574
2022-06-10 13:28:51 +00:00
Ian Jackson
d22f6007f0
config: document semver change
2022-06-10 14:28:36 +01:00
Ian Jackson
baca49e087
config: Suppose that we might extend resolve_option to non-T::Default
...
As per point 3 in
https://gitlab.torproject.org/tpo/core/arti/-/issues/488
2022-06-10 14:23:16 +01:00
Ian Jackson
77f33176c3
config: Do not strip_option for journald (and in future)
...
As per point 1 in
https://gitlab.torproject.org/tpo/core/arti/-/issues/488
2022-06-10 14:23:13 +01:00
Ian Jackson
abea103bb0
tor-error: Fix a broken intra-doc link
...
I didn't spot this in review amongst the other messages from Nightly.
2022-06-10 13:45:30 +01:00
Ian Jackson
03a19f3877
tor-bytes: read_nested_*: rustfmt
...
I disagree with almost all of these layout decisions...
2022-06-10 12:30:22 +01:00
Ian Jackson
8fe63b3192
tor-bytes: read_nested_*: Take a closure
...
This eliminates the possibility of writing the bug of failing to call
`should_be_exhausted`.
As per this discussion
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/572#note_2811464
Fixes #498
2022-06-10 12:27:00 +01:00
Ian Jackson
a38c86a020
Merge branch 'format-ids' into 'main'
...
Replace four very similar "ids in request"
See merge request tpo/core/arti!577
2022-06-10 11:21:15 +00:00
Ian Jackson
dc387e10a6
dirclient: Fix comments re conssensus request without authorities
2022-06-10 11:25:34 +01:00
Dimitris Apostolou
9bbb0cf3dd
Fix typos
2022-06-10 07:03:50 +03:00
Nick Mathewson
a2c6bd08fe
Fix typos in docs and comments
2022-06-09 17:08:56 +01:00
Ian Jackson
bcf3bca211
tor-cell: udp: Remove manual length calculations
...
This does away entirely with `wire_addr_len`, which recapitulates the
length calculation.
2022-06-09 17:08:56 +01:00
Ian Jackson
6f92bf9e86
tor-bytes: Provide nested writers
2022-06-09 17:08:56 +01:00
Ian Jackson
a6a48c3c28
tor-bytes: Provide nested readers
2022-06-09 17:08:56 +01:00
Ian Jackson
04bca2e75a
tor-bytes: Reader: Provide take_rest
...
We'll want this in a moment.
2022-06-09 17:08:56 +01:00
Ian Jackson
655804f804
tor-bytes: Prepare errors for nested reader/writer
...
Writing is going to be able to give errors too.
2022-06-09 17:08:56 +01:00
Ian Jackson
1c6ca6d286
channel padding timer: Explain why next() in select_biased!
2022-06-09 16:56:33 +01:00
Ian Jackson
9c92022663
channel padding timer: document state invariants
...
There aren't very many.
2022-06-09 16:31:11 +01:00
Ian Jackson
be04c05cce
Fix more typos in comments, from a spellchecker
2022-06-09 16:31:08 +01:00
Nick Mathewson
b9db07fea9
Fix typo in comment
2022-06-09 15:01:56 +00:00
Nick Mathewson
1adc65ab53
Fix erroneous comment
2022-06-09 14:58:30 +00:00
Nick Mathewson
5815e14b94
Fix typos in comments
2022-06-09 14:58:17 +00:00
Ian Jackson
eb7bcc963b
dirclient: Replace four very similar "ids in request"
...
In reviewing !553 I noticed that the empty digest list error had to be
handled in two places. I filed #492 about the duplication.
In fact it turns out to have been quadruplication.
The new code also avoids cloning the underlying objects, instead
sorting a Vec of references.
2022-06-09 15:05:32 +01:00
Ian Jackson
361e1ba21b
dirclient: Test consensus request based on empty ConsensusRequest
...
I'm not sure this is right. But providing a test case for it before
my next change ensures that my refactoring doesn't change the
behaviour.
2022-06-09 15:03:44 +01:00
Ian Jackson
7e7cda1656
Merge branch 'less-servfail' into 'main'
...
return nodata instead of servfail in some instances
See merge request tpo/core/arti!564
2022-06-09 11:12:58 +00:00
Ian Jackson
3f2e164bc5
tor-proto: padding: Test padding timer distribution
2022-06-08 16:04:58 +01:00
Ian Jackson
bbcdf9dd8b
tor-proto: channel: Use padding::Timer
2022-06-08 16:04:58 +01:00
Ian Jackson
0027b2371f
tor-proto: channel: Provide padding::Timer
2022-06-08 16:04:58 +01:00
Ian Jackson
af92d72b39
Change to exhaustive match.
2022-06-08 16:02:22 +01:00
trinity-1686a
e3c9152977
update semver.md
2022-06-08 16:02:22 +01:00
trinity-1686a
6c6998a65b
try to differentiate transient from nontransient error
2022-06-08 16:02:01 +01:00
trinity-1686a
515a96a46e
return nodata instead of servfail in some instances
2022-06-08 16:02:01 +01:00
Ian Jackson
3260a9b720
Fix a second docs link
2022-06-08 14:41:22 +01:00
Ian Jackson
35664c33e2
Fix a doc link
2022-06-08 14:39:18 +01:00
Ian Jackson
d202c3e9ca
Merge branch 'sleep' into 'main'
...
Plumb a SleepProvider (now Clone + ....) into Channel
See merge request tpo/core/arti!569
2022-06-08 10:46:37 +00:00
Ian Jackson
8eb215bf81
Document semver changes
2022-06-08 11:24:26 +01:00
Ian Jackson
e8fc1036d3
Plumb a SleepProvider into the channel reactor
...
The channel reactor is going to want to be able to sleep so that it
can do padding, so it needs a SleepProvider.
2022-06-08 11:24:26 +01:00
Ian Jackson
3ba3b26842
rt-compat: Make all the individual runtime traits Clone+Send etc.
...
This will make it much more convenient for code that only wants one of
these traits (or a subset of them). This is a good thing to support
because it will allow us to use a ZST in places that do not need an
actual async runtime handle (typically, the runtime handle is needed
only for spawn).
2022-06-08 11:24:26 +01:00
Nick Mathewson
47a8c05ff3
Fix a rustdoc link.
2022-06-07 19:19:53 -04:00
Nick Mathewson
5854e4bbd9
Merge branch 'use-testing-rng'
2022-06-07 19:02:12 -04:00
Nick Mathewson
b1b7f30de0
Merge branch 'netdir_provider_in_guardmgr_v2' into 'main'
...
Use NetDirProvider in GuardMgr
Closes #93
See merge request tpo/core/arti!568
2022-06-07 20:46:27 +00:00
Nick Mathewson
68942f0c40
Merge branch 'tor-netdoc-tests' into 'main'
...
Scattered tests throughout tor-netdoc
See merge request tpo/core/arti!562
2022-06-07 18:31:40 +00:00
Nick Mathewson
126bf7dace
Netdoc tests: extract decode-base64-ignore-ws code.
2022-06-07 12:45:59 -04:00
Nick Mathewson
d30899d387
microdesc: make sure we recover from an error in the final md.
...
(This is slightly different from recovering from errors in the
middle of a list of mds, since in this case we _can't_ advance to the
next md.)
Also, note that a given branch is probably not reachable.
2022-06-07 12:45:59 -04:00
Nick Mathewson
42d6d02fbe
netdoc: test case for microdesc with no ed25519 id.
...
The "bad-id" microdescriptor is hand-edited based on one from a
Chutney network.
2022-06-07 12:45:57 -04:00
Nick Mathewson
48fff1d735
netdoc: test a couple of accessors for AuthCert.
2022-06-07 12:45:57 -04:00
Nick Mathewson
97c8c27514
Netdoc: test enforcement for items that mustn't take objects.
...
Found via coverage.
2022-06-07 12:45:57 -04:00
Nick Mathewson
c5e56c734d
netdoc: remove an unused method.
2022-06-07 12:45:57 -04:00
Nick Mathewson
41be108b51
netdoc: Test more accessors for tokenized documents.
2022-06-07 12:45:57 -04:00
Nick Mathewson
102600e1c7
Netdoc: add accessor to error for ParseErrorKind
...
The kind type was already public, but we didn't give the user any
way to get it.
2022-06-07 12:45:57 -04:00
Nick Mathewson
171aa5ea00
netdoc: tests for parsing UnvalidatedEdCert.
2022-06-07 12:45:57 -04:00
Nick Mathewson
086ad51f82
tor-cert: Make more types Clone and Debug.
...
(Not sure how we missed this before. This is part of making more of
tor-netdoc tested.)
2022-06-07 12:45:57 -04:00
Nick Mathewson
9641d5ff59
Tests for netdoc RsaPublic type.
2022-06-07 12:45:57 -04:00
David Goulet
3da4b95434
udp: New AddressPort used in cells
...
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-06-07 12:29:51 -04:00
Ian Jackson
a591bf353a
udp: Allow empty hostname and no nul byte
...
After changes to the prop339, the domain name in an Address can only be
255 bytes max and can NOT contain nul byte(s).
Unit tests had to be modified to accept this change:
- Centralise msg_ip_address
- Add currently-passing tests for address length
- Test counted address length longer than type wants
Related to #463
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-06-07 12:23:27 -04:00
David Goulet
2ea709674d
cell: Don't use NUL terminated string in CONNECT_UDP
...
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-06-07 12:22:05 -04:00
David Goulet
8fd6541985
cell: Move UDP to its own module and feature gate it
...
Related to #463
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-06-07 12:22:05 -04:00
David Goulet
8cb012ed78
cell: Implement DATAGRAM cell from prop339
...
Decoding and encoding of the DATAGRAM cell from proposal 339.
Related to #463 .
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-06-07 12:22:05 -04:00
David Goulet
b7ae1976b5
cell: Implement CONNECTED_UDP cell from prop339
...
Decoding and encoding implemented according to proposal 339.
Related to #463
2022-06-07 12:22:05 -04:00
David Goulet
d74482cd90
cell: Implement CONNECT_UDP cell from prop339
...
Decoding and encoding is implemented according to proposal 339
specifications.
Related to #463
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-06-07 12:22:05 -04:00
Nick Mathewson
5aebe1f198
Sort tor-rtmock dependencies.
2022-06-07 11:51:07 -04:00
Nick Mathewson
cfad648e16
Merge branch 'llcrypto-openssl' into 'main'
...
add support for openssl backend in llcrypto
Closes #442
See merge request tpo/core/arti!550
2022-06-07 15:50:48 +00:00
Nick Mathewson
20eeca135b
GuardMgr: Use installed netdir provider when we want a netdir
...
Some of our existing code optionally takes a netdir from the
caller. When it doesn't give us one, use the netdir from the
installed NetDirProvider.
(Possibly someday we should remove the NetDir arguments
entirely. I'm deferring that because there are only two APIs
affected, and because making this change would force us to rewrite a
pretty large mess of unit tests.)
2022-06-07 11:44:51 -04:00
Nick Mathewson
dc0a4e3c3d
Move responsibility for GuardMgr NetDir updates to GuardMgr.
...
Previously it was the job of a task in CircMgr to do this; but we're
going to want to give GuardMgr full access to the latest NetDir for
this, and for other code-simplification reasons.
With this change I'm deprecating a couple of functions in
tor-circmgr. It's no longer necessary for us to have an artificial
external way for you to feed new NetDirs to a circmgr. (I could
just remove them, but I want practice deprecating.)
2022-06-07 11:44:51 -04:00
Nick Mathewson
957eb929a0
Remove now-redundant Send+Sync constraints alongside NetDirProvider
2022-06-07 11:44:51 -04:00
Nick Mathewson
2223398eb1
Make NetDirProvider require Send and Sync.
...
Our own code is the only stuff that consumes NetDirProvider, and all
the code that consumes it wants it to be Send and Sync.
Making this change avoids our having to define a new function to
upcast Arc<dyn Foo> to Arc<dyn NetDirProvider + Send + Sync>.
2022-06-07 11:44:51 -04:00
Nick Mathewson
3502a12da2
Add a `sleep` function to TaskSchedule.
...
Having this alias makes it easier to implement more complex
schedules, like those used in DirMgr.
2022-06-07 10:41:44 -04:00
Nick Mathewson
897a2d5fa0
Add "suspend" and "resume" to TaskSchedule.
...
Unlike "cancel" and "fire", "suspend" and "resume" don't change any
pending timers or events: they just prevent execution of those
events for a while, and let them resume later on.
2022-06-07 10:11:49 -04:00
Nick Mathewson
aa3a81c3ba
Upgrade serial_test dev-dependency to 0.7.0
2022-06-07 09:22:24 -04:00
Nick Mathewson
7f785b66c2
Upgrade float_eq dev-dependency to 1.0.0
2022-06-07 08:03:55 -04:00
Nick Mathewson
df06e7b9bc
Upgrade tls-api to latest versions in arti-hyper.
2022-06-07 08:01:39 -04:00
Dimitris Apostolou
8488192ba1
Fix typos
2022-06-05 18:47:51 +03:00
Nick Mathewson
018fda4f73
Merge branch 'testing-rng' into 'main'
...
New facility for deterministic and reproducible test PRNGs.
See merge request tpo/core/arti!561
2022-06-02 21:11:36 +00:00
Nick Mathewson
0e6a54351d
Add an upcast_arc function to NetDirProvider.
...
This uses some apparently-standard trickery to implement a function
that lets us upcast from Arc<dyn Subtrait> to Arc<dyn Supertrait>.
I considered as alternatives `as_dyn_trait` and `cast_dyn_object`.
Both were nice, but generated a far larger interface than this.
2022-06-02 17:06:11 -04:00
Nick Mathewson
1076f25031
Rewrite tests in tor-netdir to use testing_rng()
...
The randomized tests in this crate take a lot of iterations to
converge, so they default to using a deterministic PRNG seed with
few iterations and higher tolerance, and they only randomize the
tests (with more iterations and tighter tolerances) when you
explicitly opt in to randomization.
(If you specify a seed explicitly, you're doing that to reproduce a
randomized case, so we use the same behavior.)
2022-06-02 15:48:41 -04:00
Nick Mathewson
b4c0febd97
Refactor fallback-set tests to work with deterministic PRNG.
...
The trouble was that one of the helper functions they used
did not take a PRNG as an argument.
2022-06-02 14:59:55 -04:00
Nick Mathewson
967ea67b7d
Use testing_rng() in tests throughout our crates.
...
This only affects uses of thread_rng(), and affects them all more or
less indiscriminately. One test does not work with
ARTI_TEST_PRNG=deterministic; the next commit will fix it.
2022-06-02 14:56:42 -04:00
Nick Mathewson
69d352a7c7
New facility for deterministic and reproducible test PRNGs.
...
The new `testing_rng()` function is meant as a replacement for
thread_rng() for use in unit tests. By default, it uses a randomly
seeded RNG, but prints the seed before the test so that you can
reproduce any failures that occur. You can override this via the
environment to use a previous seed, or by using a deterministic
seed for all your tests.
Backend for #486 .
2022-06-02 14:51:51 -04:00
Ian Jackson
c2d8dac1ce
Merge branch 'better-fs-mistrust-badpermissions-string' into 'main'
...
fs-mistrust: Improve BadPermission string
See merge request tpo/core/arti!554
2022-06-02 11:15:52 +00:00
Ian Jackson
9f4fe6a484
tor-config: Fix a doc link
...
Nightly cargo doc complaints about this.
2022-06-01 15:48:45 +01:00
Nick Mathewson
07dc49a2dc
Fix a copy-paste error in Ed25519 parsing tests.
...
We accidentally tried to validate (invalid) ed25519 keys
as curve25519 keys.
2022-06-01 08:32:09 -04:00
Nick Mathewson
3de2496303
Add test for parsing bad tor version with too many elements.
...
This is a coverage-driven test.
2022-06-01 08:32:09 -04:00
Nick Mathewson
3e693fa717
Add test for mutability of RelayFamily.
2022-06-01 08:32:09 -04:00
Nick Mathewson
526fd424f7
Tests for tor_netdoc::util::intern
2022-06-01 08:32:09 -04:00
Ian Jackson
98ccd7e7e2
Merge branch 'lint' into 'main'
...
lints: Make lint blocks consistent and ensure they stay that way
Closes #469
See merge request tpo/core/arti!557
2022-05-31 18:27:53 +00:00
Alex Xu (Hello71)
bc6b02045e
fs-mistrust: Improve BadPermission string
...
To me, "Incorrect permissions on file or directory /path: g=w o=w"
implies that the current permissions on /path are 022.
Change the message to "Incorrect permissions: /path is
u=rwx,g=rwx,o=rwx; need g-w,o-w", which is closer to chmod syntax and is
more useful in non-interactive environments such as CI and support.
2022-05-31 14:23:01 -04:00
Alex Xu (Hello71)
201107906c
fs-mistrust: BadPermission(_, _) -> BadPermission(..)
...
Next commit adds another parameter to Error::BadPermission.
2022-05-31 14:15:03 -04:00
Nick Mathewson
a53b3d67d8
Merge branch 'data-stream-err' into 'main'
...
proto: Only ready a DataStream if CONNECTED was succesfully received
See merge request tpo/core/arti!556
2022-05-31 17:05:39 +00:00
Ian Jackson
9aec60871c
Merge branch 'config-test' into 'main'
...
arti config: Check that example config is exhaustive
See merge request tpo/core/arti!546
2022-05-31 16:33:27 +00:00
trinity-1686a
1d41ae92c7
use the right feature name for llcrypto openssl
2022-05-31 18:27:51 +02:00
Ian Jackson
558ae0673d
Merge branch 'self_digests_error_if_0' into 'main'
...
tor-dirclient: Require that self.digests is nonempty
See merge request tpo/core/arti!553
2022-05-31 16:21:28 +00:00
David Goulet
710709313b
proto: Only ready a DataStream if CONNECTED was succesfully received
...
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-05-31 12:20:18 -04:00
Ian Jackson
89c4f76b6c
tor-config: Suppress unwrap lint in tests
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/546#note_2808892
2022-05-31 16:58:14 +01:00
Nick Mathewson
d707f6215e
Merge branch 'config-desc' into 'main'
...
arti-config: Change description of tombstone crate
See merge request tpo/core/arti!558
2022-05-31 15:25:44 +00:00
Ian Jackson
5b684020ed
tor-config: resolve_option tests: disable rsutfmt
2022-05-31 16:06:32 +01:00
Ian Jackson
c2fa37c56a
tor-config: Add comprehensive tests for resolve_option
2022-05-31 16:06:32 +01:00
Ian Jackson
32e4baa4c4
arti: Demote itertools back to dev-dependency
2022-05-31 15:45:07 +01:00
Ian Jackson
c938eeb386
arti-config: Change description of tombstone crate
...
I was looking to see if we could delete this altogether but I
discovered that on lib.rs the description does not say it's a removed
crate, in the summaries.
Fix this.
2022-05-31 15:26:41 +01:00
Ian Jackson
fec706c2f3
lints: Make lint blocks consistent
...
The remaining consequences of running add_warning
2022-05-31 15:24:11 +01:00
Ian Jackson
91b341de34
lints: arti-testing: Move some allows outside the auto block
2022-05-31 15:24:01 +01:00
Ian Jackson
de92a295fb
lints: tor-protover: Move two allows outside the auto block
...
These need to survive.
2022-05-31 15:24:01 +01:00
Ian Jackson
4f42101554
lints: Add let_unit_value allow to all crates
...
From running add_warning, with manual picking of the right
hunks/lines.
2022-05-31 15:23:52 +01:00
Nick Mathewson
f67c0eaf50
Merge branch 'tor-config-tests' into 'main'
...
Add a few coverage-based tests to tor-config.
See merge request tpo/core/arti!540
2022-05-31 14:08:51 +00:00
Ian Jackson
4634c1712b
lints: arti: Move some allows outside the auto block
...
These need to survive.
2022-05-31 14:39:17 +01:00
Nick Mathewson
ca94ec72ef
Add a few coverage-based tests to tor-config.
...
There's nothing major here, but it does fill in a few gaps.
2022-05-31 08:59:30 -04:00
Nick Mathewson
9fed0b39fa
Merge branch 'dbg' into 'main'
...
Revert "Remove dbg!()s in tor-config"
See merge request tpo/core/arti!552
2022-05-31 12:38:59 +00:00
Ian Jackson
ba0843da4a
lints: Add lint block delimiters to every crate
...
This was the result of:
maint/add_warning crates/*/src/{lib,main}.rs
and then manually curating the results.
2022-05-31 13:00:31 +01:00
Ian Jackson
1351945d87
lints: arti-config: Re-add standard lint list
...
We are going to make lints the same for every crate.
2022-05-31 13:00:31 +01:00
Ian Jackson
eb49bc7f46
lints: Suppress unknown lints in a way that works on nightly too
...
This is ridiculous.
2022-05-31 13:00:21 +01:00
Neel Chauhan
04579c0328
tor-dirclient: Require that self.digests is nonempty
2022-05-30 11:46:54 -07:00
trinity-1686a
0f290da005
add support for openssl backend in llcrypto
2022-05-30 17:22:31 +02:00
Ian Jackson
fe9fb6b6ee
arti config: Check that example config is exhaustive
...
This is the final piece of #457 .
2022-05-30 16:03:01 +01:00
Ian Jackson
0a324f843f
mistrust: Canonicalise prefix from Some("") to None
...
This allows us to add the proper default example to the arti example
config file.
2022-05-30 16:00:45 +01:00
Ian Jackson
ca60859dff
arti: config: Canonicalise ports, and provide example dns_port
...
Now the validated configuration will never be `Some(0)`, even if that
is what was written in the config file. The arti CLI parser can still
produce this, so we don't touch the code that actually uses this.
(Without the canonicalisation the default builder produces `None` for
the `dns_port`, but the example would produce `Some(0)`, which is
semantically identical but fails the test.)
See https://gitlab.torproject.org/tpo/core/arti/-/issues/488 for some
background.
2022-05-30 16:00:45 +01:00
Ian Jackson
fbfaecdf72
config: Provide tor_config::resolve_option and resolve journald
...
Canonicalise the `logging.journald` setting in the validated
configuration. Now it will never be `Some("")`, even if that is what
was written in the config file.
This allows us to write `journald = ""` in the example configuration.
(Without the canonicalisation the default builder produces `None` and
the example would produce `Some("")`, which are semantically identical
but fail the test.)
See https://gitlab.torproject.org/tpo/core/arti/-/issues/488 for some
background.
2022-05-30 16:00:45 +01:00
Ian Jackson
fb54b5b032
arti: config example: Add entries for tor_network fields
...
These weren't previously discussed. It's not practical or useful to
show the actual default values here.
2022-05-30 16:00:45 +01:00
Ian Jackson
116b6c30e0
arti: config example: Add some missing defaults
...
Found by my forthcoming test.
2022-05-30 16:00:45 +01:00
Ian Jackson
d365d73889
arti: example config: Arrange to uncomment logfiles
...
This makes the config default parser see just "[ ]", an empty list,
which is indeed the default.
2022-05-30 16:00:45 +01:00
Ian Jackson
b88c1c1093
tor-config: Drop Serialize and Deserialize from a test type
...
These violate our rule that *built* structs ought not to be desr.
But this is just in a test.
2022-05-30 16:00:45 +01:00
Ian Jackson
c8d5681ff1
arti: Make ProxyConfig no longer Deserialize
...
That this remained was an oversight.
2022-05-30 16:00:45 +01:00
Ian Jackson
e0d9d24348
arti: cfg: Actually uncomment *all* the things in the example
2022-05-30 16:00:45 +01:00
Ian Jackson
017906cdc7
tor-dirmgr: Fix DirSkewTolerance
...
This was upposed to be one day, I presume!
Also complete a truncated sentence in the docs.
2022-05-30 16:00:45 +01:00
Ian Jackson
5824992471
Merge branch 'post-release-fix-20220527' into 'main'
...
Fix minor issues found while publishing crates for Arti 0.4.0
See merge request tpo/core/arti!547
2022-05-30 14:57:49 +00:00