Commit Graph

469 Commits

Author SHA1 Message Date
Ian Jackson 27bdc97141 Merge branch 'clippy' into 'main'
clippy: Suppress needless_pass_by_value in tests

See merge request tpo/core/arti!1535
2023-08-23 13:24:18 +00:00
Gabriela Moldovan 978122622e
tor-netdoc: Remove semver.md
Removing the private `IntroPointDesc` isn't really a breaking change,
and neither is changing the type of `HsDescBuilder::intro_points`'s
argument (because nobody would've been able to this function in the
first place as `IntroPointDesc` was never exported from tor-netdoc), so
let's remove the semver.md.
2023-08-23 13:13:11 +01:00
Gabriela Moldovan 884ed48750
tor-netdoc: Fix clippy lints. 2023-08-23 13:13:07 +01:00
Gabriela Moldovan 7df5f4d4a9
tor-netdoc: Remove redundant `IntroPointDesc` struct.
This commit replaces `tor_netdoc::hsdesc::inner::IntroPointDesc` with
the (almost identical) `tor_netdoc::hsdesc::IntroPointDesc`.

The only difference between the two structs is that
`inner::IntroPointDesc` wraps a `Vec<LinkSpec>` instead of a
`Vec<EncodedLinkSpec>`. Since `EncodedLinkSpec` can be derived from
`LinkSpec` (and vice-versa), and since `hsdesc::inner::IntroPointDesc`
never made it in our public API, this commit also removes
`hsdesc::inner::IntroPointDesc` in favour of `hsdesc::IntroPointDesc`.
2023-08-23 13:13:04 +01:00
Ian Jackson 42df88d6bf Run maint/add_warning to add lint block everywhere 2023-08-23 10:34:00 +01:00
Nick Mathewson 80c921c637 Resolve warnings about ambiguous/redundant doc links
Nightly rustdoc now warns if you have a link that isn't necessary,
and if you have a link that might refer to two different things.
2023-08-22 09:00:33 -04:00
Emil Engler 73059827f0
tor-bytes: deprecate always_bug with From trait
This commit deprecates the `EncodeError::always_bug` function with a
`From<EncodeError> for Bug` trait, which is a more semantically correct
way to perform this action.
2023-08-17 13:52:29 +02:00
Nick Mathewson cec6d0ce33 Run add_warnings on all files. 2023-08-04 07:45:04 -04: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
Dimitris Apostolou 947ddfff0c
Fix typos 2023-07-22 10:10:34 +03:00
Nick Mathewson bcf574cef5 Merge branch 'explain_952_fix' into 'main'
Explain the code for the #952 fix.

See merge request tpo/core/arti!1391
2023-07-11 09:53:09 +00:00
Ian Jackson 473447a82e Run maint/add_warning to actually apply new lint allows 2023-07-10 13:49:51 +01:00
Nick Mathewson c2601ec896 Explain the code for the #952 fix.
Let's explain what Trinity did in its fix for #952, so that we know
why this code is here the next time we find it.
2023-07-10 08:00:08 -04:00
trinity-1686a 2d170425c0 be more lenient while parsing inner hs desc 2023-07-07 21:06:05 +02: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 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
Nick Mathewson 65e81bf0ca Bump minor versions on crates with breaking changes
Done with:
```
cargo set-version --bump minor -p tor-hsclient
cargo set-version --bump minor -p arti-rpcserver
cargo set-version --bump minor -p tor-hscrypto
cargo set-version --bump minor -p tor-cell
```
2023-06-30 08:38:16 -04:00
Nick Mathewson 6e2b48c6b9 Merge branch 'rustdoc_fix' into 'main'
Fix a rustdoc link.

See merge request tpo/core/arti!1351
2023-06-29 20:53:41 +00:00
Nick Mathewson 90b5ce7fd7 Merge branch 'stabilize-hs-client' into 'main'
Mark all {hs,onion-serivce}-client features as non-experimental.

Closes #896

See merge request tpo/core/arti!1347
2023-06-29 18:50:30 +00:00
Nick Mathewson 474c313ab0 Fix a rustdoc link. 2023-06-29 14:33:34 -04:00
Ian Jackson 729bff6ff9 Merge branch 'maxintro3' into 'main'
tor-netdoc: Handle anomalous numbers of introduction points

See merge request tpo/core/arti!1332
2023-06-29 17:09:46 +00:00
Nick Mathewson d164a9dac2 Mark all {hs,onion-serivce}-client features as non-experimental. 2023-06-29 13:09:37 -04:00
Nick Mathewson 4803f6447d netdir: Move voting_period() to netdoc::Lifetime
I was going to add a comment about "doing this if we need the voting
period anywhere else" but it turns out that we also use it in dirmgr.
2023-06-29 08:19:37 -04:00
Ian Jackson 47b577d7a0 tor-netdoc: Placate clippy (fmt) 2023-06-28 18:57:06 +01:00
Ian Jackson 56813d9650 tor-netdoc: Placate clippy 2023-06-28 18:56:49 +01:00
Ian Jackson 8908d39872 tor-netdoc: Test hsdescs inners with a variety of IPT counts (fmt) 2023-06-28 16:29:05 +01:00
Ian Jackson de63a6092d tor-netdoc: Test hsdescs inners with a variety of IPT counts 2023-06-28 16:28:19 +01:00
Ian Jackson cf4adad96e tor-netdoc: hsdesc: Disregard intro points after the MAX'th 2023-06-28 16:28:11 +01:00
Ian Jackson 0e2f804d8f tor-netdoc: Reject hsdescs with no intro points
None of the existing NetdocErrorKinds seemed right.
2023-06-28 16:27:05 +01:00
Ian Jackson ebb3455b3e Conditionalise an import
Fixes a warning with
  cargo clippy --locked --offline --workspace --all-targets
2023-06-28 12:56:09 +01:00
pinkforest 4be2e3ce0f Back down x25519-dalek to 2.0.0-pre.1 from 2.0.0-rc.2
=========================
Notes from nickm:

(This differs from pinkforest's original MR: It removes the
Cargo.lock changes and the version bump on tor-llcrypto.)

Minimal Cargo.lock changes from downgrade.

(These are exactly those changes generated by running "build" and
"test".)

There are several reasons to do this:

  * It's best to bump all of our dalek dependencies at once to rc.3
    or later, rather than the piecemeal approach we've been stuck
    with so far.

  * We don't want to do this bump right now, since there are some
    tricky questions about clamping we need to figure out (see
    #808), and we need to make sure we get them right, and we're in
    a distracted this week.

  * We _do_ need to move away from 2.0.0-rc.2 right now, since
    it was causing a failure in `cargo install arti`, and then it
    got yanked.

Thanks to pinkforest for helping us out here and explaining all of
this!

Fixes #926.

Commit-edited-by: Nick Mathewson <nickm@torproject.org>
2023-06-27 13:55:24 -04:00
Nick Mathewson 357f8ebf8d Merge branch 'netdoc-todos-again' into 'main'
netdoc: Resolve nearly all remaining TODO HS items.

See merge request tpo/core/arti!1304
2023-06-26 14:55:27 +00:00
Nick Mathewson 5f0855f3df netdoc: remove final TODO HS
Although this Errorkind is not perfect, it is good enough.
2023-06-26 09:57:26 -04:00
Nick Mathewson 83fbae201d netdoc: Downgrade TODO on EncryptedHsDesc::decrypt 2023-06-26 09:57:26 -04:00
Nick Mathewson 0933937567 netdoc: Remove "decrypted_with_id" as meaningless
Actually, never mind about adding an accessor here: this value was
set incorrectly and didn't match its documentation.  As such it's
basically useless, and we might as well throw it out.
2023-06-26 09:57:26 -04:00
Nick Mathewson 6313f0513e netdoc: Remove dead_code exception; add accessors.
This commit removes some actual dead code and additionally adds some
minimal accessors to HsDesc to expose some of its properties.  (I'm
trying to keep these minimal since it's not yet clear whether we
want to expose more detail here.)

Here we also make StoredHsDescMeta a conditional type that's only
present when the new "hs-dir" feature is enabled.  Neither relays
nor clients need this: Only HsDirs will need it, when we finally
implement relays.
2023-06-26 09:57:26 -04:00
Nick Mathewson 2f513fd82d netdoc: Note new feature in itertools 2023-06-26 09:41:34 -04:00
Nick Mathewson 0bffdf23a4 Upgrade to itertools 0.11.0
The breaking changes here do not seem to affect us.
2023-06-26 09:30:54 -04:00
Nick Mathewson c653a8ce89 netdoc: change a TODO HS about a distinguisher to a NOTE.
(We explicitly do not care if Arti can be distinguished from C tor.)
2023-06-26 08:45:06 -04:00
Nick Mathewson 69dcacd69b netdoc: replace a test TODO with a reference to other tests
The tests called for here already existed.
2023-06-26 08:45:06 -04:00
Nick Mathewson e3b13f6cd8 netdoc: fill in some test data
This resolves some TODO HS items now that we are confident we want
to have these actual examples in our tests.
2023-06-23 11:23:18 -04:00
Nick Mathewson 18982e6b93 hsdescerror: Add paragraph breaks to docs. 2023-06-22 13:44:56 -04:00
Nick Mathewson 90f653f582 netdoc: Use a dev-dependency on anyhow to fix a doc example 2023-06-22 13:42:40 -04:00
Nick Mathewson dbd2552178 netdoc: Introduce HsDescError
For higher-level HsDesc-related functions, this type indicates where
exactly an error occurred.  It lets us distinguish decryption errors
from parsing errors, and attribute responsibility to the hsdir, the
onion service, or the user's lack of encryption.

This lets us remove some just-introduced complexity in
tor-hsclient.
2023-06-22 12:43:30 -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
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
Nick Mathewson dd944bc787 Generate correct ErrorKinds for hsdesc decryption failures.
Part of #736
2023-06-21 10:22:42 -04:00
Ian Jackson 161b9844da lints: Run maint/add_warning to actually apply new lints 2023-06-21 12:15:41 +01:00
Nick Mathewson f41b1178c5 netdoc: downgrade two accessor-related TODOs 2023-06-20 14:02:04 -04:00