Commit Graph

469 Commits

Author SHA1 Message Date
Ian Jackson 22bb5bacc0 Merge branch 'main' into 'main'
Use humantime in tor-checkable and tor-guardmgr

Closes #663

See merge request tpo/core/arti!1037
2023-02-28 19:22:53 +00:00
Nick Mathewson f41449d0bd Patchlevel bumps for remaining changed crates.
These crates have had small code changes, but no API additions:

tor-config
tor-socksproto
tor-cert
tor-chanmgr
tor-ptmgr
tor-guardmgr
tor-circmgr
tor-dirclient
tor-dirmgr
arti
tor-hsservice
tor-congestion

These crates have had API extensions:

fs-mistrust
tor-llcrypto
tor-bytes
tor-checkable
tor-linkspec
tor-netdoc
tor-persist
arti-client
2023-02-28 07:13:27 -05:00
Nick Mathewson 3e1ae65212 Bump tor-units version for breaking change.
(The breaking change was removing `as_days()` from IntegerMinutes.)

We are _not_ calling this a downstream-api breaking change, per
discussion at
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012?commit_id=bb2ab7c2a3e0994bb438188511688b5b039cae29#note_2876819
2023-02-28 07:10:00 -05:00
Nick Mathewson 3e257a7cb5 Bump minor versions for significant breaking changes.
This includes tor-cell, tor-proto, and tor-netdir.
2023-02-28 07:05:15 -05:00
Saksham Mittal dfb94f510d
Use humantime in tor-guardmgr 2023-02-27 21:24:29 +05:30
Nick Mathewson f1ec64bfe5 Upgrade to latest toml crate.
(None of the breaking changes affect us this time.)
2023-02-14 11:06:00 -05:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
These changes influence behavior, but not effect compatibility.
(If I messed up, and any crate except for `arti` has non-breaking
API changes, that's still fine, since they are all version
0.x.)
2023-02-01 10:23:58 -05:00
Nick Mathewson 2127c6b088 "Fix" remaining unchecked-subtraction warnings.
In both cases I think it's fine to panic; but it's best to do so
explicitly.
2023-01-27 09:16:41 -05:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
Nick Mathewson f9903789d1 Upgrade toml to version 0.6.
This required rewriting some of our error handling code in
command-line processing, since the toml crate now displays and
reports errors differently.  (Admittedly, this code still is kind of
ugly, but at least it is nicely hidden.)
2023-01-25 16:29:53 -05:00
Nick Mathewson 889206cde4 Complete our migration to base64ct.
This is in lieu of upgrading to the latest base64 crate, which has
a different API from the old one.  Since we have to migrate either
way, we might as well use base64ct everywhere.

I don't think that most of these cases _require_ constant-time
base64, but it won't hurt.
2023-01-20 08:06:30 -05:00
eta 118050e54c Merge branch 'test-lints' into 'main'
Add test lint blocks to all "mod test"

See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
eta fbae20537c Merge branch 'bug589a' into 'main'
Remove allow(unreachable_pub) from tor-guardmgr/src/lib.rs

Closes #589

See merge request tpo/core/arti!944
2023-01-06 17:14:03 +00:00
Emil Engler 8579bc66a8
doc: consistent summary line for the READMEs
This commit introduces a consistency to the summary line of all
README.md files in each and every crate.
2022-12-20 14:31:47 +01:00
Neel Chauhan 23db2944cc Remove allow(unreachable_pub) from tor-guardmgr/src/lib.rs
Closes #589
2022-12-16 13:23:57 -08:00
Ian Jackson 125a455bdc test lint blocks: Add many many automatically
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson ed08cce1b5 Rename for_circuit_usage => as_relay_with_desc 2022-11-30 13:16:51 -05:00
Ian Jackson e4ac39e638 bridge config: Add a TODO about a redundant clone 2022-11-30 15:49:34 +00:00
Ian Jackson 429d2c7cb7 bridge config: Rename accessors
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858480
2022-11-30 15:49:34 +00:00
Ian Jackson 117bee5808 bridge config: Use unreachable, not None.expect
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858479
2022-11-30 15:49:34 +00:00
Ian Jackson 199a6e0754 Separate BridgeAddr and PtTargetAddr
As per
  https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220

This commit is difficult to split up.

The innards of BridgeAddr and PtTargetAddr are still a bit entangled.
2022-11-30 15:49:34 +00:00
Nick Mathewson bdddb78828 Merge branch 'more-linkspec-tests' into 'main'
Add tests for a bunch of code in tor-linkspec

See merge request tpo/core/arti!867
2022-11-29 18:41:54 +00:00
Ian Jackson b36a23cfd3 Merge branch 'ptmgr-optional-dep' into 'main'
Support building without pluggable transports

Closes #649

See merge request tpo/core/arti!898
2022-11-29 18:26:30 +00:00
Ian Jackson 1bd606ab5c guardmgr: Conditionalise DisplayRule::Redacted
This is unused in bridgeless configs.  Fixes a compiler warning.
2022-11-29 16:32:14 +00:00
Nick Mathewson 6b12c5d1de guardmgr: remove todo about bridge::config::Inner members
We've revised this a few times; now it seems plausible.
2022-11-29 11:03:44 -05:00
Nick Mathewson 0c0f3d1faf guardmgr: Remove now-unneeded #[allow(unnecessary_wraps)] 2022-11-29 11:00:27 -05:00
Nick Mathewson 5d6044f3fc Rustdoc fix: escape []s. 2022-11-28 09:36:15 -05:00
Nick Mathewson 45c4beff7a Fix up compatibility issues between linkspec tests and other patches 2022-11-28 08:29:33 -05:00
Nick Mathewson cf9f29158f GuardMgr: Treat Guards as sensitive and Bridges as redacted.
This machinery is a bit inelegant, but it is all confined to
be within the GuardMgr crate, so IMO it should be fine for now.
2022-11-28 08:01:53 -05:00
Nick Mathewson 29f903bdac Display guards in redacted form in guard status messages.
Closes #627, again.

Closes #648.
2022-11-28 08:01:53 -05:00
Nick Mathewson 8cf9e2a6a4 Merge branch 'chanmethod-non-exhaustive' into 'main'
Make ChannelMethod non-exhaustive

See merge request tpo/core/arti!891
2022-11-27 19:36:22 +00:00
Nick Mathewson 984bd6012a Merge branch 'reconfig-bridges-bad' into 'main'
Require state ownership when using bridges

Closes #612

See merge request tpo/core/arti!889
2022-11-27 19:30:00 +00:00
Ian Jackson 1a39a0c7e9 Make ChannelMethod non-exhaustive
Enums with variants conditional on cargo features must be
non-exhaustive, because cargo features are supposed to be additive,
meaning that enabling a feature (which might happen due to some random
distant thing) ought not to break things using that enum.

There were surprisingly few places to fix this.
2022-11-24 17:17:36 +00:00
Ian Jackson 04082ab7a9 tor-guardmgr: rustfmt for recent changes
Left unsquashed for ease of review
2022-11-24 14:31:05 +00:00
Ian Jackson ecd0e121a8 tor-guardmgr: NoLock error: add TODO for trying to get lock
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856874
2022-11-24 14:31:05 +00:00
Ian Jackson 112e28d88e tor-config: Rename to ReconfigureError::UnsupportedSituation
From Unsupported.  Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873
This was added in this MR.

Also add the missing semver note.
2022-11-24 14:31:03 +00:00
Ian Jackson fa918446ac tor-config: Rename to ConfigBuildError::NoCompileTimeSupport
From Unsupported.  Following one of the suggestions here
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873

This was added in 2c37116149 which was
not yet in a release so this isn't a semver break.  I have added
the semver note that was omitted in that MR.
2022-11-24 14:30:58 +00:00
Nick Mathewson ce0f8f41cb Merge branch 'bridge-config-arc' into 'main'
Make BridgeConfig be Arc, so no Arc<BridgeConfig>

Closes #635

See merge request tpo/core/arti!885
2022-11-23 17:52:26 +00:00
Ian Jackson fbd4b88044 Merge branch 'test-config' into 'main'
tor-guardmgr: Fix visibility of TestConfig with no features enabled

See merge request tpo/core/arti!875
2022-11-23 17:51:05 +00:00
Nick Mathewson e25ed00fd1 Merge branch 'remove_deadcode_allow' into 'main'
guardmgr: Remove a now-unneeded "allow(dead_code)"

See merge request tpo/core/arti!862
2022-11-23 17:45:26 +00:00
Ian Jackson ecaf8b23b8 tor-guardmgr: Refuse to configure bridges if we don't have the lock
Fixes #612
2022-11-23 13:03:14 +00:00
Ian Jackson c0b297c99c tor-guardmgr: make replace_bridge_config fallible
The error type needs to be convertible to GuardMgrError and also to
ReconfigureError.  Neither of those is right, so we need a new error
type.
2022-11-23 13:00:10 +00:00
Ian Jackson 8cddb0a06a tor-guardmgr: Replace a let _ignore with a typed version
`let _ignore =` isn't great because if the function called is
currently infallible, but becomes fallible, it suppresses the
detection of the error check.

A better pattern is to specify the type of the ignored value.

I'm about to do precisely this, here.

I did a git-grep and `let _ignore =` seems very common.  Let's not
deal with all those now.
2022-11-23 13:00:05 +00:00
Nick Mathewson c0aa10d409 CircMgr: retire all circuits if bridge configuration changes.
Closes #650.
2022-11-22 12:53:32 -05:00
Ian Jackson ee87097dc1 BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfig
BridgeConfig is itself an Arc now, so these are redundant.
2022-11-22 15:33:21 +00:00
Ian Jackson 3caf7aafc0 BridgeConfig: Make it be a newtype around Arc<Inner>
This leaves the external API of this type unchanged, but now it's much
smaller and quite cheap to clone.
2022-11-22 15:33:21 +00:00