Commit Graph

5524 Commits

Author SHA1 Message Date
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
Nick Mathewson 59e812bdbe Merge branch 'update' into 'main'
Run cargo update in preparation for release tomorrow

See merge request tpo/core/arti!1000
2023-01-31 21:02:04 +00:00
Nick Mathewson 970cc6cb29 Run cargo update in preparation for release tomorrow 2023-01-31 15:37:48 -05:00
Ian Jackson 705638df22 Merge branch 'docsrs' into 'main'
Disable ./maint/check_doc_features

Closes #601

See merge request tpo/core/arti!985
2023-01-30 17:17:41 +00:00
Ian Jackson 24d00c4e8f Maine ./maint/check_doc_feature a warning
This is a fair amount of manual work to keep in sync.  I would like to
disable this, at least as a mandatory check, for now.

Fixes #601 (the request for it to become non-blocking).
The underlying issue is #581 and remains open.

Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr>
2023-01-30 16:49:54 +00:00
Nick Mathewson 2afbea6a74 Merge branch 'srv_accessors' into 'main'
Export SRV information from NetDoc up to NetDir, and TimePeriod from NetDir

Closes #686

See merge request tpo/core/arti!987
2023-01-28 18:11:29 +00:00
Nick Mathewson f6cbd180a1 netdir: remove duplicate code in param calculation 2023-01-28 12:43:08 -05:00
Nick Mathewson 4e7a552171 netdir: remove the vestigial smallvec implementation I added
It's cute, but I don't think it will help performance, and I'm
undecided about whether the semantic implications are true.
2023-01-28 12:43:08 -05:00
Nick Mathewson 268a723e49 Turn compute_ring_params into a method. 2023-01-28 12:43:08 -05:00
Nick Mathewson 2490b3cdc6 Use derive_more on SharedRandVal
This may be temporary if we wind up converting to CtByteArray,
but for now it's good to be terse.
2023-01-28 12:43:08 -05:00
Ian Jackson a51c76178e Several suggestions on gitlab. 2023-01-28 12:43:08 -05:00
Nick Mathewson 5236c5cf88 netdir: Implement ring-param constructors and time period accessors
This logic is a bit tricky, so I've tried to document it and add
fairly good tests.  The silver lining is that the external API for
all of this logic will make it invisible and hidden.

There are some cases where I added functions that I think might
eventually get lowered into MdConsensus: But I don't want to lower
too much right now, since the convention for our netdoc accessors is
that they are fairly unsophisticated, and they show you the document
as it is.

Closes #686
2023-01-28 12:43:08 -05:00
Nick Mathewson 9f3e6783ca netdoc: Add Eq and a note to SharedRandVal. 2023-01-28 12:12:17 -05:00
Nick Mathewson 790b38eec8 netdoc: Add SRV accessors.
These are deliberately unsophisticated accessors, in that they return Option<>
rather than filling in missing values with the documented
fallbacks. It seems better to leave a way to distinguish the absent
case in the API.
2023-01-28 12:12:17 -05:00
Nick Mathewson c1ced84239 netdoc: Add a timestamp to SRVs per prop#342.
This breaks some experimental APIs, but since they are experimental
no semver note is needed.
2023-01-28 12:12:17 -05:00
Nick Mathewson 8ce447b7e2 netdoc: Add Iso8601 time _with_ a "T" as an argument type. 2023-01-28 12:12:17 -05:00
Nick Mathewson 4aaace640b Merge branch 'typos' into 'main'
Fix typos

See merge request tpo/core/arti!996
2023-01-28 00:18:09 +00:00
Dimitris Apostolou 3da36c5c8b
Fix typos 2023-01-28 01:31:10 +02: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
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