Commit Graph

52 Commits

Author SHA1 Message Date
Nick Mathewson 9f44408bb9 Upgrade rsa, zstd, httpdate. Remove redundant pin-project. 2021-04-05 08:26:29 -04:00
Nick Mathewson 89cae112b6 hs_ntor: add a disclaimer and put it behind a feature. 2021-04-02 08:34:03 -04:00
Nick Mathewson 3833ca2665 Move stream timeout logic into tor-client.
This is consistent with the other pieces of tor-proto, which do not
handle timeouts on their own.  It also lets us remove tor-rtcompat
as a dependency from tor-proto, and simplify some of the test cases
to use async_test.

This commit unindents a lot of test code; use git's "-b" flag to
read the parts that matter.
2021-03-24 11:14:07 -04:00
Nick Mathewson 603b0436e0 Add a compatibility layer so we can upgrade rand_core.
dalek-crypto is stuck on rand_core 0.5.1, so we've been stuck too.
This commit introduces a compatibility module so that we can wrap
new rand_core instances to make them backward compatible.
2021-03-18 13:16:32 -04:00
Nick Mathewson a4e0dde4da Add appropriate categories to some Cargo.toml files. 2021-03-17 14:51:18 -04:00
Nick Mathewson 6daf57957d Add the tor project as an author. 2021-03-17 14:43:40 -04:00
Nick Mathewson ba14d43be4 Add keywords to each Cargo.toml 2021-03-17 14:41:02 -04:00
Nick Mathewson c8481a9354 Add a description field to all our Cargo.toml files 2021-03-17 14:31:59 -04:00
Nick Mathewson 58d8472ea0 Give it a homepage everyplace. 2021-03-17 14:13:26 -04:00
Nick Mathewson 4818d57ed7 Bump a couple of deps 2021-03-13 17:25:05 -05:00
Nick Mathewson 6a97e3ba08 Revise DataReader to implement AsyncRead.
The tricks I needed here turned out to be:

  * I needed to store the future returned by read_cell() while it is
    returning Poll::Pending.

  * Since the type of that future is secret, I needed to put it in a
    Box<dyn Future>.

  * But since that future holds a reference to the DataReader, that
    would create a self-referential structure if we tried to store
    the DataReader and the future at the same time.  So instead, I
    had to make an enum() that either holds a DataReader directly,
    or holds the future that will give us back the DataReader when
    it's done.  (I also had to change the read_cell() function so
    that it takes ownership of the DataReader, and returns it when
    it's finished.)  (Daniel Franke explained how to do this.)

  * Finally, I couldn't figure out how to change the enum's type
    in-place, so I had to wrap it in an Option<>.  (Daniel Franke
    says this isn't actually necessary.)

I've noted a couple of places in the read code where I want to
handle errors and closes more carefully.
2021-03-10 10:39:56 -05:00
Nick Mathewson 302653977d Bump dependencies with "cargo upgrade" 2021-03-06 08:55:13 -05:00
Nick Mathewson 8c31418500 Port to work with tokio or async-std.
This is fairly ugly and I think I'll need to mess around with the
feature configuration a while until we get something that's pleasant
to develop with.  This still seems like a good idea, though, since
we _will_ need to be executor-agnostic in the end, or we'll have no
way to handle wasm or embedded environments.

Later down the road, we'll probably want to use futures::Executor or
futures::Spawn more than having global entry points in
tor_rtcompat.  That would probably make our feature story simpler.

Tokio is the default now, since tokio seems to be more heavily used
for performance-critical stuff.

This patch breaks tests; the next one will fix them, albeit
questionably.
2021-03-02 11:55:09 -05:00
Nick Mathewson 568567c5e0 Update to latest futures, once_cell 2021-02-23 15:54:29 -05:00
Nick Mathewson ab9d4a2229 Update some dependencies. 2021-02-19 09:39:23 -05:00
Nick Mathewson e1c3f550d8 upgrade a few dependencies 2021-02-10 18:23:38 -05:00
George Kadianakis 92e678be6a Implement timeout for new streams (set to 120 seconds). 2021-02-05 23:38:32 +02:00
Nick Mathewson 243880473f bump serde and log 2021-02-01 16:39:07 -05:00
Nick Mathewson 3f455e6f30 require latest futures crate 2021-01-15 17:05:05 -05:00
Nick Mathewson a27eeb1e61 Migrate from futures_codec to asynchronous_codec.
asynchronous_codec is a fork of futures_codec that is up-to-date on
its dependencies.

This migration allows us to upgrade to the current version of the
bytes crate.
2021-01-15 17:01:07 -05:00
Nick Mathewson fa57fb4995 Upgrade a few more dependencies. 2021-01-13 08:17:14 -05:00
Nick Mathewson 7e843de2c8 Upgrade a few dependencies. 2021-01-13 08:14:28 -05:00
Nick Mathewson f01d641ec8 cargo upgrade. 2020-12-30 15:59:33 -05:00
Nick Mathewson 5057cbc12f Cargo-upgrade a few dependencies 2020-12-21 10:18:41 -05:00
Nick Mathewson e18b4e07cb Upgrade a couple of dependencies 2020-11-28 14:17:42 -05:00
Nick Mathewson af16ec18a3 update some dependencies 2020-11-11 09:14:26 -05:00
Nick Mathewson 4d24fff9c0 Upgrade dependencies 2020-11-10 12:27:10 -05:00
Nick Mathewson 9c7ed1fdde upgrade a few packages. 2020-11-05 16:56:29 -05:00
Nick Mathewson ee9ad7f59d Run "cargo upgrade". 2020-10-26 14:56:06 -04:00
Nick Mathewson a796f7bf6a Use event_listener to find out about sendme replenishment.
Previously we would fail if a sendme window was exhausted and two
tasks were waiting for it to be replenished at the same time.
2020-10-26 14:25:46 -04:00
Nick Mathewson b528c914ff Start on some tests for pieces of tor-proto::channel 2020-10-21 12:45:36 -04:00
Nick Mathewson 3408c9ad26 Run "cargo upgrade". 2020-10-15 13:32:02 -04:00
Nick Mathewson beee7a7f2a cargo upgrade 2020-09-29 16:43:16 -04:00
Nick Mathewson 8d5957ca4b test vectors for cell crypto. 2020-09-28 21:36:10 -04:00
Nick Mathewson b710e5c770 Split the cell-handling parts of tor-proto into a new crate. 2020-09-26 12:49:03 -04:00
Nick Mathewson 653de035bc Make sendme authentication optional.
This code deviates from current tor in that it allows missing
sendme authentications only when we know we're talking to an old
relay, or when we don't know the version of the relay we're talking
to.
2020-09-25 19:20:32 -04:00
Nick Mathewson 0c131dc080 Run cargo upgrade 2020-09-21 13:45:36 -04:00
Nick Mathewson f20eb2f43f proto::channel: add piping to move cells around.
There's a "reactor" task to move cells to the appropriate circuit,
and a "send_cell" to send a cell directly.

This is client-only for now.
2020-09-11 13:58:05 -04:00
Nick Mathewson ee71abe560 Pare down and sort dependencies 2020-09-09 19:17:49 -04:00
Nick Mathewson 9f30b47cb7 Run cargo upgrade, except for stream-cipher. 2020-09-09 19:06:00 -04:00
Nick Mathewson 8d01a0a808 Implement most of client-side channel cert validation. 2020-09-09 16:19:42 -04:00
Nick Mathewson e45e6f5954 Work on client channel handshake: mostly done, except for verification 2020-09-09 14:32:41 -04:00
Nick Mathewson 875e932898 New "linkspec" module to encapsulate info needed to connect/extend. 2020-09-08 20:43:15 -04:00
Nick Mathewson 7095192063 proto: small err cleanups 2020-09-06 17:50:06 -04:00
Nick Mathewson e749e2bc27 proto: major refactor to channel cells
The protocol is now based around a message-oriented scheme intended
to use futures_codec, which in turn uses BytesMut.  The transition
to BytesMut is incomplete, and we're not nearly so zero-copy as
intended.  We should think about that.
2020-09-06 16:00:14 -04:00
Nick Mathewson 4b75c51882 Run cargo-upgrade. 2020-08-28 18:14:17 -04:00
Nick Mathewson 173bec26a5 Update to latest packages; ed25519 now needs signature crate traits. 2020-07-20 20:55:03 -04:00
Nick Mathewson c602883881 Use "cargo upgrade" from cargo-edit to list current versions 2020-06-12 21:06:07 -04:00
Nick Mathewson 6264041b77 update to use latest rust-crypto traits and modules 2020-06-10 14:16:07 -04:00
Nick Mathewson 86894926aa tor-proto: use caret_int!() for cell and relay commands. 2020-05-15 16:27:03 -04:00