Commit Graph

5610 Commits

Author SHA1 Message Date
Nick Mathewson 3c82f794c1 ErrorHint: refactor API (part 2)
Change ErrorHint so that, internally, it just holds an enum with a
lightweight reference to whatever parts of the error it needs to
generate a hint.  Then we can move the formatting logic into a
Display function for ErrorHint, and do away with ErrorDetail entirely.
2023-01-27 11:56:53 -05:00
Nick Mathewson b8058c5d02 ErrorHint: refactor API (part 1)
Move the "hint" function into Error, and use Option rather than Result.

(I'm using Option here because it's not really an error case not to have
a hint; we just either have a hint, or we don't.)
2023-01-27 11:56:53 -05:00
Shady Katy cc4c07678a add opaque ErrorHint API, impl ErrorHint from BadPermissions 2023-01-27 11:02:42 -05:00
Nick Mathewson 074c027a5d Merge branch 'llvm-tools' into 'main'
maint: replace llvm-tools-preview with llvm-tools

See merge request tpo/core/arti!993
2023-01-27 15:38:04 +00:00
Emil Engler 54f549dd53
maint: replace llvm-tools-preview with llvm-tools
This commit replaces all occurrences of `llvm-tools-preview` with
`llvm-tools`, because it became a stable feature with Rust 1.60, thereby
making the `-preview` prefix obsolete. Beside this, `llvm-tools-preview`
is a redirection to the latter one anyway.

However, it does not work the other way around. At the moment, it is not
possible to execute the `maint/coverage` script on a NixOS system,
because the rustup component list only includes `llvm-tools`, but not
`llvm-tools-preview`, thereby making this change necessary.
2023-01-27 15:56:09 +01:00
Nick Mathewson 06c1b00b32 Merge branch 'no_clippy_warnings' into 'main'
Fix clippy warnings from Rust 1.67

Closes #749 and #748

See merge request tpo/core/arti!992
2023-01-27 14:45:17 +00:00
Nick Mathewson b7c8646d7b circmgr: drop a receiver more explicitly.
Clippy now complains about `let _ = (expr_producing_a_future);`,
which is probably smart, since maybe you wanted to await that future
and ignore the result.  So it seems that the right way to get rid of
an unwanted Receiver is now to drop it explicitly.

Closes #749
2023-01-27 09:16:51 -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 ed74c62931 Elide a bunch of lifetimes.
Clippy now warns about these; I'm not sure how these warnings snuck
up on us.
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 b8403c9bf7 Merge branch 's101-o3-january' into 'main'
Update C Tor specific numbers for s101-o3 for January

See merge request tpo/core/arti!991
2023-01-27 12:32:48 +00:00
Alexander Færøy d41dbc2a46 Update Tor number for s101 o3 (Tor: 2033cc7b5e). 2023-01-27 12:50:06 +01:00
Alexander Færøy e30ece3532 Fix typo. 2023-01-27 12:46:14 +01:00
Emil Engler 9357a8fd6b
ci: add shebang to the GitLab CI 2023-01-26 21:06:52 +01:00
Emil Engler 53bf3492e8
maint: add shebang
This commit adds a test called `shebang`, which checks if all shebangs
in scripts use relative paths through `#/usr/bin/env`, rather than
absolute paths, such as `#/bin/bash`.

See 833b10575b.
2023-01-26 21:04:34 +01:00
Ian Jackson f2e254e63d Merge branch 'toml_0.6' into 'main'
Upgrade toml to version 0.6.

See merge request tpo/core/arti!989
2023-01-26 17:34:52 +00:00
Nick Mathewson b2373e6d3f Merge branch 'hscrypto_impl' into 'main'
Implement tor-hscrypto

Closes #684 and #742

See merge request tpo/core/arti!980
2023-01-26 14:28:13 +00:00
Nick Mathewson 79c6881366 exportedapisketc: note that HTTP can be tricky. 2023-01-26 08:29:46 -05:00
eta 51741398b2 Merge branch 'netdoc-builder' into 'main'
tor-netdoc: Provide NetdocEncoder (internal)

See merge request tpo/core/arti!984
2023-01-26 11:40:50 +00:00
eta 02d15dc5c1 Merge branch 'env' into 'main'
shell: use /usr/bin/env instead of absolute paths

See merge request tpo/core/arti!988
2023-01-26 11:35:38 +00:00
eta cd7059f5c7 Merge branch 'sensitive' into 'main'
tor-proto: Mark stream ids in errors as sensitive

See merge request tpo/core/arti!986
2023-01-26 11:31:46 +00: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 422e3382aa New results for heap_and_download_size.md 2023-01-25 14:59:46 -05:00
Nick Mathewson 790f21032a hscrypto: Remove Credential.
It turns out that the credential is only calculated as an
intermediate result in order to blind keys and produce the
subcredential. As such, it has no need to leave the hscrypto module.
2023-01-25 14:34:16 -05:00
Nick Mathewson b4c4a21297 hscrypto: add a note about maybe replacing epoch_offset with voting_interval 2023-01-25 14:15:53 -05:00
Nick Mathewson 9864fd9db8 hscrypto: Explain why vanity onions require expanded secret keys. 2023-01-25 14:14:32 -05:00
Nick Mathewson 4399722ada hscrypto: document why we have keys in un-expanded form 2023-01-25 14:07:04 -05:00
Nick Mathewson 360e84afab hscrypto: Note that maybe Duration is the wrong type to use. 2023-01-25 13:59:50 -05:00
Nick Mathewson 904688467c hscrypto: Note the need for a Result rather than an Option 2023-01-25 13:57:57 -05:00
Ian Jackson ab0edd55e0 Apply several clarifications (and fixes for missing refs) 2023-01-25 18:54:48 +00:00
Nick Mathewson 386de7587e hscrypto: Use derive_more, and derive Deref for public keys. 2023-01-25 13:48:40 -05:00
Emil Engler 833b10575b
maint: update shellcheck_all with /usr/bin/env
This commit updates the shellcheck_all script, in order to look for
/usr/bin/env, instead of /bin.
2023-01-25 18:43:14 +01:00
Emil Engler 79097484de
shell: use /usr/bin/env instead of absolute paths
This commit changes the shebang in all shell scripts from absolute
paths (such as `/bin/bash` or `/usr/bin/python3`) to the `/usr/bin/env`
binary with the accompanying interpreter as it's argument.

The reason for this are as follows:
- NixOS cannot work with absolute paths
- BSD systems install their packages in /usr/local/bin
2023-01-25 18:35:53 +01:00
Nick Mathewson fe6575ef98 hscrypto: Revise TimePeriod to account for variable offset.
Previously, the offset was set to 12 hours unconditionally (like the
spec says).  But based on a conversation on tor-dev, it seems that
the offset should actually be 12 times the voting interval.

I'm also opening an MR to change the spec.
2023-01-24 15:04:40 -05:00
Nick Mathewson 108bb72c5e hscrypto: Add documentation for ClientSecretKeys 2023-01-24 13:40:59 -05:00
Nick Mathewson 93cdb0a2c3 Add a note about why we use ExpandedSecretKey for OnionIdSecretKey 2023-01-24 13:40:59 -05:00
Nick Mathewson 00aaf79620 hscrypto: Add our standard clippy warnings
(I have squashed the fixes for these warnings into the earlier
commits in this branch, so it will look like I did everything right
the first time.)
2023-01-24 13:40:59 -05:00
Nick Mathewson f192429442 hscrypto: Implement key blinding.
This implementation was made based on the specification, and then
validated against itself, and against C Tor.
2023-01-24 13:40:59 -05:00
Nick Mathewson 3dfeb5b144 hscrypto: Add an implementation for TimePeriod
This required some API tweaks, which is probably to be expected;
these time periods are a wonky kind of thing.
2023-01-24 13:33:48 -05:00
Nick Mathewson 0a52d90af3 hscrypto: Implement hs_mac. 2023-01-24 13:33:48 -05:00
Nick Mathewson 44e9d31af9 hscrypto: Improve documentation for RendCookie 2023-01-24 13:33:48 -05:00
Nick Mathewson 49afcafadd hscrypto: use a macro to define our byte wrappers too. 2023-01-24 13:33:48 -05:00
Nick Mathewson 7e4ad381a8 hscrypto: Add and use a macro to define all PK types. 2023-01-24 13:33:46 -05:00
Nick Mathewson 36485218c3 hscrypto: A couple of spelling fixes. 2023-01-24 13:32:18 -05:00
Nick Mathewson 23bbf17d38 hscrypto: Associate each type with new name from rend-spec-v3.txt 2023-01-24 13:32:18 -05:00
Nick Mathewson 3b2848f904 Merge branch 'onion-api-highlevel' into 'main'
Onion-service APIs: circmgr, hsclient, hsservice

See merge request tpo/core/arti!972
2023-01-24 18:19:42 +00:00
Ian Jackson 590c139af9 tor-proto: Mark stream ids in errors as sensitive
Pursuant to #556
2023-01-24 18:08:40 +00:00
Nick Mathewson 5b4ffc5e48 Note a needed isolation API. 2023-01-24 12:32:21 -05:00
Nick Mathewson 606426bfc7 hsservice: Add a note about the contents of circ_info.
In order to store per-circuit information, it's a good idea if we
provide something that can be the key of a `PtrWeakKeyHashMap`.
2023-01-24 12:32:21 -05:00