Commit Graph

225 Commits

Author SHA1 Message Date
Ian Jackson 42df88d6bf Run maint/add_warning to add lint block everywhere 2023-08-23 10:34:00 +01:00
Gabriela Moldovan 31645f4f37
tor-error, arti: Bump backtrace to 0.3.68.
Previously we were using backtrace 0.3.39, which has a [bug] that causes
it to segault in some circumstances. I experienced this bug while trying
to fix the minimal-versions build in !1508.

[bug]: https://github.com/rust-lang/backtrace-rs/issues/267
2023-08-15 16:34:31 +01:00
Gabriela Moldovan 5d0fb5177f
tor-error: Remove KeystoreFsPermissions variant.
According to the `ErrorKind` lumping guidelines, `KeystoreFsPermissions`
should be lumped with `FsPermissions`: they represent the same type
of error, and their "location" is the same ("Host").

Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1315#note_2916455
2023-08-08 16:46:20 +01:00
Nick Mathewson cec6d0ce33 Run add_warnings on all files. 2023-08-04 07:45:04 -04:00
Nick Mathewson 3422169ff4 Merge branch 'bump_versions_117' into 'main'
Vesion bumps for 1.1.7.

See merge request tpo/core/arti!1458
2023-08-01 15:40:26 +00:00
Nick Mathewson 3acdf102c7 Increment patchlevel versions of crates with minor changes
These crates are at version 0.x.y, so we don't need to distinguish
new-feature changes from other changes:

```
tor-basic-utils
fs-mistrust
tor-error
tor-geoip
tor-checkable
tor-linkspec
tor-netdoc
tor-netdir
tor-persist
tor-ptmgr
tor-hsservice
```

This crate has a breaking change, but only when the semver-breaking
feature `experimental-api` is enabled:

```
tor-config
```

This crate is at version 1.x.y, but has no new public APIs, and
therefore does not need a minor version bump:

```
arti
```
2023-08-01 10:57:55 -04:00
Nick Mathewson 6f2ae59603 Update minor versions on crates that have had breaking changes
These crates had first-order breaking changes:

```
retry-error
tor-keymgr
tor-proto
tor-hsclient
tor-rtmock
```

Additionally, these broke because they re-exposed RetryError:

```
tor-circmgr
```

Additionally, these broke because they may re-expose something from
tor-proto:

```
    arti-client
    tor-chanmgr
    tor-dirclient
    tor-dirmgr
    tor-guardmgr
```

Additionally, these broke for other fiddly reasons:

`tor-ptmgr` implements traits from tor-chanmgr, which has a breaking
change above.

`arti-hyper` exposes types from arti-client in its API.
2023-08-01 10:51:25 -04:00
Nick Mathewson 9ce6f0a0eb Run "fixup features" in preparation for a release. 2023-08-01 08:32:20 -04:00
Ian Jackson 882ce8c8ce retry-error: Provide fmt_error_with_sources in retry-error
This code came from tor-error.  So now tor-error depends on
retry-error.
2023-07-19 14:16:13 +01:00
Ian Jackson fd2e4979be clippy: tor-error: Use convert::identity for into_internal!
This launders the closure so that clippy's
clippy::redundant_closure_call can't see it.

We can't have a local #[allow] because it would be on an expression,
which isn't allowed on stable.

This avoids having to use more clumsy idioms at call sites.
2023-07-10 13:49:51 +01:00
Ian Jackson 473447a82e Run maint/add_warning to actually apply new lint allows 2023-07-10 13:49:51 +01:00
Nick Mathewson 53c599d50f Fix warn_report and error_report macros.
Originally they didn't check err.kind(), since err.kind() can never
increase their severity.  We lost that behavior with !1386, and we
became dependent on it with arti!1383.  Since they both merged at
the same time, CI broke.

This patch restores their original behavior.
2023-07-07 15:46:41 -04:00
Ian Jackson 696adc3c94 tor-error: tracing module: Use macro to generate macros
This abolishes some quintuplication.

The output is identical except that:
 * The syntax display in the rustdoc output for the resulting macros
   seems to have somewhat less whitepsace.
 * The whimsical error messages in the examples are all identical.
   Ah well.
2023-07-07 18:38:24 +01:00
Ian Jackson 220900a852 tor-error: tracing module: Fix link to tracing macro 2023-07-07 17:48:05 +01:00
Nick Mathewson 70f0fe634f Merge branch 'report-bugs-v2' into 'main'
Optional tracing support in tor-error for error reporting

See merge request tpo/core/arti!1379
2023-07-07 13:49:59 +00:00
Nick Mathewson 023d288ba2 event_report: assert correctness of format ending
(Also, document that this static assertion is the reason why you are
seeing a confusing error message.)
2023-07-07 09:00:31 -04:00
Nick Mathewson 7168feefdd tor-error: Add optional tracing support
The main contribution here is a set of convenience macros for
logging error `Report`s.  Notably, this macros always logs
`Internal` and `BadAspiUsage` errors at `WARN`, unless they
are already at `ERROR` or more.

This is a little tricky because `tracing::event!()` requires
its Level argument to be a constant.
2023-07-07 09:00:31 -04:00
Nick Mathewson 03f9f9987a Run add_warning to remove `missing_panics_doc` deny.
Closes #950.
2023-07-06 14:32:23 -04:00
Nick Mathewson afa51fd5ca Add TODO comments about possibly migrating away from the backtrace crate. 2023-07-05 16:39:11 -04:00
Nick Mathewson 27bd990a79 Remove semver.md files for 1.1.6 2023-06-30 10:28:53 -04:00
Nick Mathewson de13a7319b Bump patchlevel versions on crates with smaller changes
Done with the commands below.

The following crates have had various changes, and should get a
patchlevel bump. Since they are pre-1.0, we do not need to
distinguish new APIs from other changes.

```
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-circmgr
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p tor-linkspec
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-netdoc
cargo set-version --bump patch -p tor-proto
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-socksproto
```

This crate has new features, but no new non-experimental Rust APIs.
So even though it is post-1.0, it gets a patchlevel bump.

```
cargo set-version --bump patch -p arti
```
2023-06-30 08:42:21 -04:00
Ian Jackson 69129bf2b4 tor-error: Make KeystoreFsPermissions experimental for now
Let's defer this decision.
2023-06-29 19:51:04 +01:00
Gabriela Moldovan 6ed8f5b9ea tor-error: Add KeystoreAccessFailed, KeystoreFsPermissions to ErrorKind. 2023-06-28 11:59:00 +01:00
Gabriela Moldovan c8a128cc59 tor-error: Add KeystoreCorrupted to ErrorKind. 2023-06-28 11:59:00 +01:00
Nick Mathewson 085c45ed18 tor-error: Mark define_asref_dyn_std_error as non-experimental
(I see no problems with this macro.  In the worst case, we deprecate
it someday.)
2023-06-23 12:49:46 -04:00
Nick Mathewson 3ccec0b04a tor-error: Stabilize OnionService error kinds 2023-06-22 13:17:08 -04:00
Nick Mathewson 3d4181bcd4 tor-error: typo fix in a comment. 2023-06-22 13:15:50 -04:00
Nick Mathewson 33bfa7c7a8 Remove onion service descriptor-related errorkinds.
These have been subsumed by other errorkinds, mostly
OnionServiceProtocolViolation and TorProtocolViolation.

In particular please review the change in tor-hsclient closely;
I am not sure about the new errorkinds for the error there.
2023-06-22 13:11:06 -04:00
Nick Mathewson 610ed2d457 Merge branch 'socks_errorkinds' into 'main'
Generate correct-ish socks5 errors for onion service errors.

Closes #736

See merge request tpo/core/arti!1279
2023-06-22 16:15:55 +00:00
Nick Mathewson 967cae6ced New ErrorKind for invalid onion addresses
Use this to emit HS_BAD_ADDRESS as appropriate.
2023-06-22 10:57:08 -04:00
Nick Mathewson 1a9e5b8463 Remove ErrorKind::OnionService{Intro,Rend}Failed
These errors are orthogonal to our actual error kinds.  See
discussion on #736.
2023-06-22 10:56:23 -04:00
Alexander Færøy d1658a120e Merge branch 'stderr' into 'main'
lints: Promote clippy::print_stderr and clippy::print_stdout

See merge request tpo/core/arti!1271
2023-06-21 16:41:10 +00:00
gabi-250 53a05c1e7b Merge branch 'upgrade_21June2023' into 'main'
Upgrade a couple of dependencies

See merge request tpo/core/arti!1276
2023-06-21 14:23:50 +00:00
Nick Mathewson 0505579497 Upgrade to strum 0.25. 2023-06-21 09:12:36 -04:00
Nick Mathewson 2d7756956e Add and use ErrorKinds for remaining onion service errors 2023-06-21 09:01:02 -04:00
Ian Jackson 161b9844da lints: Run maint/add_warning to actually apply new lints 2023-06-21 12:15:41 +01:00
Ian Jackson dac7a45ea8 tor-error: Introduce `LooseCmpRetryTime`
Having a newtype for this kind of thing is considerably more
convenient.  I'm going to use this in a moment.
2023-06-15 16:43:45 +01:00
Ian Jackson 57ba35dfe0 tor-hsclient: Conduct the INTRODUCE1 exchange 2023-06-13 16:14:57 +01:00
Gabriela Moldovan 44fca4c2ca
tor-error: Clarify what we mean by "hostile".
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-06-12 18:25:50 +01:00
Gabriela Moldovan de8ca98900
tor-error: Document another potential cause for OnionServiceDescriptorValidationFailed.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-06-12 18:25:46 +01:00
Ian Jackson 4827ce8548 tor-error: Extend applicability of RemoteNetworkTimeout
We're going to use this for rendezvous completion timeout, which could
be due to basically anything.
2023-06-09 17:36:48 +01:00
Ian Jackson 9d22ce9f8a tor-hsclient: impl HasKind for InvalidTarget: ..DescriptorValidationFailed
This basically always means we couldn't cope with the descriptor.

We need to extend the description of OnionServiceDescriptorValidationFailed
2023-06-09 17:36:48 +01:00
Ian Jackson 33c90e5b72 tor-error: Introduce define_asref_dyn_std_error and use it
This factors out an ad-hoc AsRef impl.  We're going to want to reuse
this for another error type.
2023-06-09 17:36:48 +01:00
Nick Mathewson daf5ecc153 Bump crate versions in preparation for v1.1.5 release.
Generated with the following commands:

```
cargo set-version --bump minor -p tor-cell
cargo set-version --bump minor -p tor-linkspec
cargo set-version --bump minor -p tor-proto
cargo set-version --bump minor -p tor-netdoc
cargo set-version --bump minor -p tor-circmgr

cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-basic-utils
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-hscrypto
cargo set-version --bump patch -p tor-checkable
cargo set-version --bump patch -p tor-async-utils
cargo set-version --bump patch -p caret
cargo set-version --bump patch -p fs-mistrust
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p retry-error
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-events
cargo set-version --bump patch -p tor-units
cargo set-version --bump patch -p tor-rtcompat
cargo set-version --bump patch -p tor-rtmock
cargo set-version --bump patch -p tor-protover
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-socksproto
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-congestion
cargo set-version --bump patch -p tor-persist
cargo set-version --bump patch -p tor-chanmgr
cargo set-version --bump patch -p tor-ptmgr
cargo set-version --bump patch -p tor-guardmgr
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-hsclient
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p arti-rpcserver
cargo set-version --bump patch -p arti-config
cargo set-version --bump patch -p arti-hyper
cargo set-version --bump patch -p arti
cargo set-version --bump patch -p arti-bench
cargo set-version --bump patch -p arti-testing
```
2023-06-01 10:03:05 -04:00
Nick Mathewson 6fa821238d Revise all XXXXs from fixup-features 2023-05-15 11:00:28 -04:00
Nick Mathewson 4b08ef76a0 Run fixup-features _with_ annotations.
This litters our Cargo.toml files with "XXX" entries that we should
fix.
2023-05-15 10:41:32 -04:00
Nick Mathewson 7a5373c110 Run fixup-features --no-annotate for initial Cargo.toml fixes.
This does the following:
  - Gives every crate a `full`.
  - Cause every `full` to depend on `full` from the lower-level
    crates.
  - Makes every feature listed _directly_ in `experimental` depend
    on `__is_experimental`.
2023-05-15 09:07:21 -04:00
Gabriela Moldovan f6456d469d
tor-error: Add a TODO regarding HS desc parsing errors.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-05-03 17:25:36 +01:00
Gabriela Moldovan c2cb96a623
Clarify what the new ErrorKinds mean.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-05-03 17:25:29 +01:00
Gabriela Moldovan c6fccbbb01
hsclient: Use a real HsDesc instead of an unparsed string.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-05-03 17:25:21 +01:00