Commit Graph

5770 Commits

Author SHA1 Message Date
Ian Jackson 745336fac5 maint/check_licensse: Do not discard actual error
This confused me while I was debugging the interaction with nailing-cargo.
2023-02-24 17:14:27 +00:00
Ian Jackson c060fbb4a3 Merge branch 'gitignore' into 'main'
git: add maint/.gitignore for __pycache__

See merge request tpo/core/arti!1032
2023-02-24 14:07:06 +00:00
Emil Engler d6a7ace662
git: add maint/.gitignore for __pycache__
The maint/ directory contains several python scripts, which will create
a __pycache__ directory.
2023-02-22 18:31:40 +01:00
Ian Jackson ed5857fab1 Merge branch 'coverage-dep-check' into 'main'
maint: add a dependency check to coverage

Closes #776

See merge request tpo/core/arti!1025
2023-02-22 12:00:28 +00:00
Emil Engler b4b8d040a0
maint: add a dependency check to coverage
This commit implements a dependency check to the `maint/coverage`
script, that checks for the rustup, python3, and grcov binaries in
$PATH; the bs4 and lxml python packages; and the llvm-tools Rust
component.

Fixes #776
2023-02-21 20:09:17 +01:00
Ian Jackson a866866491 Merge branch 'cdf_pub_use' into 'main'
Fix a bug in check_doc_features, and fix a warning too.

See merge request tpo/core/arti!1023
2023-02-21 16:19:53 +00:00
Nick Mathewson d09273a6e3 Apply a missing cfg_attr(docsrs...) in netdoc 2023-02-21 15:18:46 +00:00
Nick Mathewson c1fbcb34f6 Rearrange cfg_attr in relaycell::msg
docsrs wants to find its `cfg_attr(docsrs...)` line after the
`cfg()` line.
2023-02-21 15:18:46 +00:00
Nick Mathewson be8f483acc Fix a bug in check_doc_features
In Python, str.find returns -1 if it doesn't find the target
character, and -1 is a true value.  So `if pos := foo.find('c')`
won't do what we want.
2023-02-21 15:17:28 +00:00
Ian Jackson 750c512264 Merge branch 'unparsed_linkspec' into 'main'
HsDesc: Use a new UnparsedLinkSpecifier to avoid leaking which linkspec types we know

See merge request tpo/core/arti!1029
2023-02-21 15:16:45 +00:00
Ian Jackson 67234568bc Merge branch 'hsdir_remove_comment' into 'main'
netdoc: Remove a TODO hs comment.

See merge request tpo/core/arti!1028
2023-02-21 15:15:10 +00:00
Ian Jackson f896d79e2a Merge branch 'update_2023_02_17' into 'main'
Run `cargo update`, work around a bug in `time`.

See merge request tpo/core/arti!1027
2023-02-21 15:14:29 +00:00
Nick Mathewson 3233c25943 tor-netdoc: Use UnparsedLinkSpec in IntroPointDesc. 2023-02-17 15:29:37 -05:00
Nick Mathewson bc68974212 tor-linkspec: New UnparsedLinkspec type.
Unlike linkspec, this doesn't validate the actual contents of the
specifiers. We'll use this so we can handle the linkspec list for an
introduction point in an HsDesc, and just pass it on when
constructing our circuits.

I haven't added any accessor or constructor functions, because I
don't expect to need them.
2023-02-17 15:26:23 -05:00
Nick Mathewson 757c6d333f netdoc: Remove a TODO hs comment.
It said to check whether C enforces an absence of extraneous bytes
at the end of the link specifiers.  It does, in
`hs_desc.c:decode_link_specifiers()`, where it says:

```
  if (link_specifier_list_parse(&specs, decoded,
                                (size_t) decoded_len) < decoded_len) {
    goto err;
  }
```

The comparison with "decoded_len" checks whether all the bytes were
decoded.
2023-02-17 15:06:09 -05:00
Nick Mathewson 4060e293fb Fix the year on the 1.1.1 changelog. 2023-02-17 14:38:57 -05:00
Nick Mathewson 2b515c8d25 tor-dirmgr: Work around an apparent regression in `time`.
Some code in our tests that worked fine with time 0.3.17 no
longer works with 0.3.19, despite the semver.

See https://github.com/time-rs/time/issues/552 for the upstream bug.
2023-02-17 14:36:19 -05:00
Nick Mathewson a300bed405 Run "cargo update" in preparation for the release in 2 weeks. 2023-02-17 14:22:57 -05:00
Nick Mathewson 925017a1a5 Merge branch 'coverage-force' into 'main'
maint: forcefully remove files in coverage

See merge request tpo/core/arti!1024
2023-02-17 13:04:19 +00:00
Nick Mathewson 1297dfb5e3 Merge branch 'doc-iter' into 'main'
tor-netdoc: Abolish PauseAt in favour of using itertools

Closes #760

See merge request tpo/core/arti!1021
2023-02-17 12:34:32 +00:00
Nick Mathewson 878531af90 Merge branch 'hs-cells-1' into 'main'
Start refactoring hs cell implementations

See merge request tpo/core/arti!1020
2023-02-16 15:36:31 +00:00
Emil Engler 66fd697a73
maint: forcefully remove files in coverage
When performing the initial run of `./maint/coverage`, it will report an
error message to stderr, that several files cannot be deleted, due to
their non-existence.

While the error is still ignored, I personally think that there is no
benefit in showing it either, thereby surpressing it with this commit.

Beside this, this syntax might be easier to understand from a semantical
point of view.
2023-02-16 15:14:08 +01:00
Nick Mathewson c4b451ffa6 Mark a quoted block as text, so doctest ignores it. 2023-02-16 09:00:07 -05:00
Nick Mathewson 14417dc098 Add a TODO about combining several macros and patterns 2023-02-16 08:25:12 -05:00
Ian Jackson b4e48b0695 Make a comment more accurate 2023-02-16 13:19:04 +00:00
Ian Jackson 66beab6c9e tor-netdoc: Fix doc comment following removal of PauseAt 2023-02-16 11:53:32 +00:00
Nick Mathewson 943e4414fe Merge branch 'max-min' into 'main'
Expire routerdescs as soon as any of their expiries expire

Closes #772

See merge request tpo/core/arti!1022
2023-02-16 01:09:56 +00:00
Ian Jackson ca127b013f Expire routerdescs as soon as any of their expiries expire
Fixes #772
2023-02-15 17:41:28 +00:00
Ian Jackson 676241c349 tor-netdoc: Run rustfmt (separately from the refactoring) 2023-02-15 17:17:01 +00:00
Ian Jackson 1993165f22 tor-netdoc: Abolish NetDocReader::iter and into_iter
Nothing uses these now; the NetDocReader is simply an iterator, itself.
2023-02-15 17:17:01 +00:00
Ian Jackson 4a91c732fe tor-netdoc: Remove many needless calls to .iter() and .into_iter() 2023-02-15 17:17:01 +00:00
Ian Jackson fa2e164939 tor-netdoc: Use impl Iterator for NetdocReader in .pause_at
This simplifies the return type!
2023-02-15 17:17:01 +00:00
Ian Jackson db79e3f369 tor-netdoc: impl Iterator etc. for NetdocReader
This will simplify things at many call sites.
2023-02-15 17:17:01 +00:00
Ian Jackson b58977b428 tor-netdoc: move PeekableIterator to util.rs
We're going to want this a bit more widely.
2023-02-15 17:17:01 +00:00
Ian Jackson 11660f84b0 tor-netdoc: Delete now-unused PauseAt type 2023-02-15 17:17:01 +00:00
Ian Jackson 15d93bd642 tor-netdoc: Use itertools to implement NetDocReader::pause_at
This is the last use of PauseAt.
2023-02-15 17:17:01 +00:00
Ian Jackson 089ebb7d11 tor-netdoc: Replace use of PauseAt::new_pred()
We can just make a new PauseAt, since it can take the inner peekable
iterator by mutable reference.

This seems to tidy the code up a bit too.
2023-02-15 17:16:57 +00:00
Ian Jackson 7491424ee9 tor-netdoc: Have sectionrules.parse take I, not &mut I
There's a blanket impl of Itertor for &mut impl Iterator, so this
isn't necessary, and it prevents us passing iterators by value
producing syntactic vinegar.
2023-02-15 17:16:57 +00:00
Ian Jackson 80d8d94c96 tor-netdoc: Import Peekable rather than referring to it by path
This makes things easier to read.  We're about to add another
site (albeit, temporarily).
2023-02-15 17:16:57 +00:00
Nick Mathewson 0f2218f4d3 Merge branch 'ticket_525_part3_take2' into 'main'
Finish #525 for relay messages: Only parse messages at the last instant.

Closes #773 and #525

See merge request tpo/core/arti!1017
2023-02-15 16:35:27 +00:00
Nick Mathewson 19c0dd153a tor-proto: Add a TODO about simplifying a common pattern. 2023-02-15 10:51:03 -05:00
Nick Mathewson 21db73f182 tor-cell: add a TODO comment about simplifying Body away. 2023-02-15 10:48:19 -05:00
Nick Mathewson fce1c83f2e tor-cell: Add another debug_assert to relay cell encoding 2023-02-15 10:48:19 -05:00
Nick Mathewson 5d28e9e7d0 slicewriter: rename a local variable. 2023-02-15 10:48:19 -05:00
Nick Mathewson 19c9593acf Move slicewriter to tor-cell and make it private.
Also, add some comments about how it is likely to change.
2023-02-15 10:48:19 -05:00
Nick Mathewson 1ee6bfa59c tor-proto: note implications for future HS work 2023-02-15 10:48:19 -05:00
Nick Mathewson 41b50b6c56 tor-proto: Push stream message parsing into the stream objects.
This closes #525, and ensures, at last, that we don't parse any
message that we wouldn't accept.
2023-02-15 10:48:19 -05:00
Nick Mathewson 58c3b8276c tor-proto: Defer parsing of messages send to half-closed streams
This includes a partial solution for #769, but also turned up
another bug (#774) while I was working on it.  I'll close them both
once I have a real solution.
2023-02-15 10:48:19 -05:00
Nick Mathewson bd0f6f5adf tor-proto: stop reactor (and kill circuit) if meta handler fails
If the meta handler reports an error, then the circuit has violated
its protocol, and needs to be shut down.

Fixes #773.
2023-02-15 10:48:19 -05:00
Nick Mathewson 2e483124cb tor-proto: defer meta-cell parsing to the last moment. 2023-02-15 10:48:19 -05:00