| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This would let us use `.parse_arg::<String>()` in old parsing code.
I wanted this for recommended versions, and then didn't use it, but it
seems useful anyway.
|
| |
|
|
|
|
|
|
| |
This commit adds #[allow(clippy::string_slice)] to all functions in the
code where string slices are used, alongside a TODO comment.
We do this add the function header to have it consistent, as things like
expression based allow's are still experimental.
|
| |
|
|
|
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182
I left the word "fixed" in some of the docs and error messages, where
it seemed to make sense.
|
| |
|
|
| |
We're going to want quite a lot of this for eg network-status-version.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Implement proposal 360 (limit HsDesc inflation opportunities)
Closes #2046
See merge request tpo/core/arti!3070
|
| | |
| |
| |
| | |
Part of proposal 360.
|
| |/
|
|
| |
Made with https://crates.io/crates/typos-cli
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Per <https://spec.torproject.org/dir-spec/netdoc.html>,
our netdocs never have a BOM, and never have internal NULs.
This makes Arti reject such documents.
For arguments on why it's okay to increase parser strictness,
see the (forthcoming) proposal 356 at torspec!342,
and see older discussion at torspec#296.
Closes #1739.
|
| |
|
|
|
|
| |
The `derive_more` crate broke backward compatibility with this version,
so this change involved quite a few manual fixups.
With luck, they'll keep compatibility for some while in the future.
|
| |
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
None of the existing NetdocErrorKinds seemed right.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Part of #736
|
| |
|
|
|
|
|
| |
`ParseErrorKind` was renamed to `NetdocErrorKind`, so we need to
rename this acccessor too.
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`parse_decrypt_validate` was marked as experimental because it was
unclear if the newly added `BadTimeBound` error kind belongs in
`ParseErrorKind`. However, we have since renamed `ParseErrorKind` to
`NetdocErrorKind` and decided to keep the new variant, so this API
doesn't need to be experimental anymore.
Closes arti #852
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
`ParseErrorSource` was originally meant to represent a parsing error,
this enum has since gained some variants that aren't really parsing
related (`Signature`, `CertSignature`, `UntimelyDescriptor`).
Since this error type is now used for general-purpose netdoc errors,
let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
| |
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
This adds the `HsDesc::parse_decrypt_validate` method, which parses,
decrypts, and validates HS descriptors.
Closes #809
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We already have `Pos::Unknown` for an error at an unknown
location and `Pos::None` for an error where no location is
sensible. There's no reason to have an additional `Option` here.
Additionally, the use of `Option` gave us a bug where our old
`ParseError::at_pos()` method didn't actually set the position
unless the position was already set. That's not what we want!
Fixes #640.
Finally, we have to fix a test that was a bit broken because it was
working around #640.
|
| |
|
|
|
| |
Empty lines were previously reported as BadKeyword, which is
confusing.
|
| |
|
|
|
|
|
|
|
| |
Some of these were for decoding particular objects (we now say
what kind of objects), and some were unrelated tor_cert errors that
for some reason we had shoved into a tor_bytes::Error.
There is now a separate tor_cert::CertError type, independent from
tor_cert's use of `tor_bytes::Error` for parsing errors.
|
| |
|
|
|
| |
The kind type was already public, but we didn't give the user any
way to get it.
|
| |
|
|
| |
It's a little overzealous sometimes, but it's mostly to the good.
|
| |
|
|
|
|
|
| |
The match was doing a deref coercion.
Found by current nightly's needless_match (whose suggestion doesn't
compile, https://github.com/rust-lang/rust-clippy/issues/8551 )
|
| | |
|
| | |
|
| |
|
|
| |
This is a followup for !314 and !310 to fix compilation on main.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This error type doesn't impement HasKind, since the kind will depend
on context.
However, the existing implementation was pretty messy and inconsistent:
Some errors had positions, some didn't.
Some took messages as str, some as String.
Some had internal errors that were somewhat orthogonal to their actual
types.
This commit refactors tor_netdoc::Error to use a ParseErrorKind, and
adds a set of convenience functions to add positions and
messages to the errors that need them.
|
| |
|
|
|
| |
Every other case of tor_netdoc::Error means a parse failure. This one,
though, means a failure to construct a document.
|
| |
|
|
| |
Nothing creates this.
|
| | |
|
| |
|
|
|
|
|
|
| |
We want to only use TODO in the codebase for non-blockers, and open
tickets for anything that is a bigger blocker than a TODO. These
XXXXs seem like definite non-blockers to me.
Part of arti#231.
|
| |
|
|
|
| |
(The nightly version of clippy now includes macros for its
missing_docs_in_private_items lint.)
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|