summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
| * tor-proto: channel: Tell clippy it's ok to print in testsIan Jackson2022-06-161-0/+1
| |
* | Merge branch 'high-level-features' into 'main'Nick Mathewson2022-06-161-0/+2
|\ \ | | | | | | | | | | | | | | | | | | Add "full" and "experimental" features to arti, arti-client, and below. Closes #499 See merge request tpo/core/arti!584
| * | Add "full" and "experimental" features to arti-client and below.Nick Mathewson2022-06-101-0/+2
| |/ | | | | | | | | | | | | | | | | The "full" feature is a catch-all for all features, _except_: * Those that select a particular implementation (like tor-llcrypto/with-openssl) or build flag (like "static") * Those that are experimental or unstable (like "experimental-api") * Those that are testing-only.
* / Permit eprintln in channel-padding test.Nick Mathewson2022-06-151-0/+1
|/ | | | | There is not, apparently, an eprintln equivalent for allow-dbg-in-tests.
* Merge branch 'channel' into 'main'Nick Mathewson2022-06-104-10/+605
|\ | | | | | | | | Have channel reactor able to send channel padding See merge request tpo/core/arti!574
| * channel padding timer: Explain why next() in select_biased!Ian Jackson2022-06-091-0/+7
| |
| * channel padding timer: document state invariantsIan Jackson2022-06-091-2/+24
| | | | | | | | There aren't very many.
| * Fix more typos in comments, from a spellcheckerIan Jackson2022-06-091-6/+6
| |
| * Fix typo in commentNick Mathewson2022-06-091-1/+1
| |
| * Fix erroneous commentNick Mathewson2022-06-091-1/+1
| |
| * Fix typos in commentsNick Mathewson2022-06-091-3/+3
| |
| * tor-proto: padding: Test padding timer distributionIan Jackson2022-06-082-0/+125
| |
| * tor-proto: channel: Use padding::TimerIan Jackson2022-06-083-12/+44
| |
| * tor-proto: channel: Provide padding::TimerIan Jackson2022-06-083-0/+409
| |
* | Change to exhaustive match.Ian Jackson2022-06-081-1/+2
| |
* | update semver.mdtrinity-1686a2022-06-081-0/+1
| |
* | try to differentiate transient from nontransient errortrinity-1686a2022-06-083-10/+23
|/
* Merge branch 'sleep' into 'main'Ian Jackson2022-06-086-57/+119
|\ | | | | | | | | Plumb a SleepProvider (now Clone + ....) into Channel See merge request tpo/core/arti!569
| * Document semver changesIan Jackson2022-06-081-0/+1
| |
| * Plumb a SleepProvider into the channel reactorIan Jackson2022-06-085-57/+118
| | | | | | | | | | The channel reactor is going to want to be able to sleep so that it can do padding, so it needs a SleepProvider.
* | Merge branch 'use-testing-rng'Nick Mathewson2022-06-078-13/+20
|\ \ | |/ |/|
| * Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-028-13/+20
| | | | | | | | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* | Merge branch 'lint' into 'main'Ian Jackson2022-05-311-0/+2
|\ \ | |/ |/| | | | | | | | | lints: Make lint blocks consistent and ensure they stay that way Closes #469 See merge request tpo/core/arti!557
| * lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | | | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* | proto: Only ready a DataStream if CONNECTED was succesfully receivedDavid Goulet2022-05-311-1/+4
|/ | | | Signed-off-by: David Goulet <[email protected]>
* Lexically sort Cargo.toml dependenciesOrhun Parmaksız2022-05-281-17/+15
| | | | | | Utilize cargo-sort: https://github.com/DevinR528/cargo-sort Signed-off-by: Orhun Parmaksız <[email protected]>
* Regenerate version bump from previous commit.arti-v0.4.0Nick Mathewson2022-05-271-2/+2
| | | | | | | This commit was made by reverting the previous commit, then re-running the script I used to generate it. In theory there should be no semantic changes: only changes due to improved formatting from cargo edit.
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* More tests for ClockSkew.Nick Mathewson2022-05-251-0/+40
|
* prepare_send_from: clippy: Replace some or_else with orIan Jackson2022-05-231-2/+2
|
* channel: Provide and use Sink::prepare_send_fromIan Jackson2022-05-231-75/+25
| | | | | | | | | | | | | | | | | | | | This is a general-purpose implementation of the ad-hoc approach currently taken in (eg) crates/tor-proto/src/channel/reactor.rs, with an API intended to defned against the more obvious mistakes. This allows us to separate the two concerns: the channel reactor can focus on handling channel cells and control messages and is over 2.5x shorter. The complexity of the manual sink implementation, and the machinery needed to avoid having to suspend while holding an item, are dealt with separately. That separate implemenation now has proper documentation. (Tests are in the nest commit to avoid this one being even more unwieldy.) We use `extend` to define this as an extension trait. A competitor is `ext` but in my personal projects I have found `extend` slightly better.
* Merge branch 'main' into 'ticket_466'Nick Mathewson2022-05-162-1/+2
|\ | | | | | | # Conflicts: # doc/semver_status.md
| * clippy: Change a binding to (), and allow clippy::let_unit_valueIan Jackson2022-05-112-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type of ret.map_err(codec_err_to_chan)? is (). ISTM that writing `let () = ` makes it clear that there is nothing there, but the lint forbids this. This lint is warn by default and trips here for me on current nightly. It seems wrong to me. We should be able to make it clear to the reader that there is nothing here - note how this differs from the lines below where Ready contains msg. A let () binding is a good way to do that. I think the lint allow ought to be added everywhere, but that doesn't seem easy right now - see this issue about maint/add_warning: https://gitlab.torproject.org/tpo/core/arti/-/issues/469
* | Add a channel accessor to ClientCirc.Nick Mathewson2022-05-111-1/+20
|/ | | | | I need this so that I can expose the skew time for the directory that a circuit will use, when I only have the circuit.
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-11/+11
| | | | * Except for safelog and fs-mistrust, which are new.
* Fix typos (using the typos-cli tool).Nick Mathewson2022-05-041-1/+1
|
* Upgrade to AES 0.8Nick Mathewson2022-04-264-5/+5
| | | | | | | | Now that we require Rust 1.56, we can upgrade to AES 0.8. This forces us to have some slight API changes. We require cipher 0.4.1, not cipher 0.4.0, since 0.4.0 has compatibility issues with Rust 1.56.
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-256-9/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-10/+10
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* handshake.rs: Document the time for clock skew authentication.Nick Mathewson2022-04-111-3/+25
|
* Implement a better clock skew estimator.Nick Mathewson2022-04-111-8/+75
| | | | | | | | This time, our estimator discards outliers, takes the mean of what's left, and uses the standard deviation to try to figure out how seriously to take our report of skew/not-skew. These estimates are still not actually used.
* Initial functions to determine and expose a clock skew estimate.Nick Mathewson2022-04-071-4/+13
| | | | | (This is just a placeholder; I'm going to make the functions smarter in the next commit.)
* chanmgr: bubble ClockSkew up through the Error object.Nick Mathewson2022-04-072-3/+1
| | | | | | | | Fortunately, we don't need a separate type here: authenticated clock skew can only come attached to a `tor_proto::Error`. We also remove skew from `tor_proto::Error::HandshakeCertsExpired`, since it would now be redundant.
* Channel: Expose our view of whether the clock is skewed, and the ageNick Mathewson2022-04-073-1/+33
| | | | | | | | of a channel. At first I wanted to have this information not be a part of channels at all, but it is a fairly tiny amount of data, and the alternatives are pretty crufty.
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-11/+11
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Merge branch 'netinfo-clock-skew' into 'main'Nick Mathewson2022-03-235-25/+231
|\ | | | | | | | | tor-proto: add the ability to learn clock skew from NETINFO cells See merge request tpo/core/arti!410
| * tor-proto: better errors when handshake fails due to untimely certsNick Mathewson2022-03-232-15/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now check the handshake certificates unconditionally, and only report them as _expired_ as a last resort. (Rationale: if somebody is presenting the wrong identity from a year ago, it is more interesting that they are presenting the wrong ID than it is that they are doing so with an expired cert. We also now report a different error if the certificate is expired, but its expiration is within the range of reported clock skew. (Rationale: it's helpful to distinguish this case, so that we can blame the failure on possible clock skew rather than definitely attributing it to a misbehaving relay.) Part of #405.
| * tor-proto: add a backend to detect reported clock skew.Nick Mathewson2022-03-234-10/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NETINFO cells, which are sent in every handshake, may contain timestamps. This patch adds an accessor for the timestamp in the Netinfo messages, and teaches the tor-proto code how to compute the minimum clock skew in the code. The computation isn't terribly precise, but it doesn't need to be: Tor should work fine if your clock is accurate to within a few hours. This patch also notes a Y2038 problem in the protocol: see torspec#80. Part of #405.