Commit Graph

8112 Commits

Author SHA1 Message Date
Nick Mathewson 207a971cd2 add a spec conformance comment 2020-09-26 19:27:15 -04:00
Nick Mathewson ad36e3acec Fix some comments that reflected a misunderstanding in SENDMEs
I had thought that the sendme authentication things used for
onion services were 32-byte; they're still only 20.
2020-09-26 19:25:51 -04:00
Nick Mathewson fa2fd4bbfe Add tests for a few more relay message types 2020-09-26 19:22:18 -04:00
Nick Mathewson 3d5cd55669 Add test vectors for a few relay message types.
I generated these by running an instrumented version of Tor through
chutney.
2020-09-26 17:32:15 -04:00
Nick Mathewson cb57d00161 Use the correct value for TAP_C_HANDSHAKE_LEN 2020-09-26 17:31:01 -04:00
Nick Mathewson d74f5f11f5 tor-proto conformance: do not write zero-valued flags in begin cell. 2020-09-26 17:24:48 -04:00
Nick Mathewson d3e4ca0ecb tor-cell: Add some test vectors for channel messages 2020-09-26 16:23:57 -04:00
Nick Mathewson a3143ab960 Run cargo upgrade. 2020-09-26 14:20:28 -04:00
Nick Mathewson 220a3acad2 update fuzzing cfg for tor-cell crate 2020-09-26 12:52:59 -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 404cec07e7 readme edits 2020-09-26 11:03:05 -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 adf5ef3f5c Lower our "#[allow(dead_code)]" decl in tor_proto." 2020-09-25 18:57:21 -04:00
Nick Mathewson aa0dc66fe3 Update TODO and README. 2020-09-25 18:49:23 -04:00
Nick Mathewson 343af46715 Improve documentation and lightly refactor SENDME code 2020-09-25 18:49:23 -04:00
Nick Mathewson 37aab00d12 Add new (disabled) demo pieces to client-demo 2020-09-25 18:49:23 -04:00
Nick Mathewson ba1600371b Implement authenticated sendme output for circuit-level sendmes.
This patch has a XXXXX kludge note in it.
2020-09-25 18:49:23 -04:00
Nick Mathewson c0ee910413 Add a bad workaround for a deadlock: we should look for a better one. 2020-09-25 17:06:33 -04:00
Nick Mathewson 6071b0e903 Fix encoding/decoding of authenticated sendme. 2020-09-25 17:06:33 -04:00
Nick Mathewson 08cfb40350 Try to get sendme crypto working
There's a problem, though: this code assumes that tags are 20 bytes
long whereas actually the tag type is part of the crypto layer info.

So maybe in the long term we need to move the queue of tags from the
send window into being part of the crypto layers.
2020-09-25 17:06:33 -04:00
Nick Mathewson bc4c05d6a7 Incomplete implementation of circuit SENDME handling.
This is incomplete because the cell crypto code doesn't actually
expose tags yet, and because it demands tags unconditionally,
without caring about the linkspec protocol version.
2020-09-25 17:06:33 -04:00
Nick Mathewson 06ede86f7f Attempted implementation of stream sendme cells 2020-09-25 17:06:33 -04:00
Nick Mathewson 92463dc03e Initial work on a sendme backend.
Parameterized for authenticated/unauthenticated operation, and
operation on circuits and streams.
2020-09-25 09:47:55 -04:00
Nick Mathewson 60ff67113f Initial error cleanup on streams/circuits 2020-09-25 08:35:48 -04:00
Nick Mathewson f945af0c41 Document private members in most crates 2020-09-24 19:25:37 -04:00
Nick Mathewson 18b13e8cae Migrate ClientMain to byte-oriented API. 2020-09-24 18:56:54 -04:00
Nick Mathewson 50848b8fa0 Try to make a send/receive style API for streams. 2020-09-24 18:03:03 -04:00
Nick Mathewson da3a8fdd50 Add support for RELAY_END cells.
This was a hard one.  I need to make sure that we send an END cell
when the stream is dropped.  But we can't call an .await from inside
the drop() function, since drop() isn't async, and we don't have an
executor.

Fortunately, you can call send() on a oneshot::Sender without having
to await on it, so that's the obvious thing to put in drop().  But
we need some way to make sure that the oneshot::Receiver is given to
the reactor, and is .awaited.  For that, we needed a control
channel.  And the reactor needs to treat the control channel and the
close messages as equally important.

So that's how I wound up with a
  Fuse<Select<mpsc::Receiver<Result<Foo>>,
              SelectAll<Once<oneshot::Receiver<Foo>>>>>.

I doubt that this is actually the best way to handle any of this!
2020-09-24 15:33:54 -04:00
Nick Mathewson 9e8350aea0 as Tor does, skip to random initial stream member. 2020-09-23 19:50:15 -04:00
Nick Mathewson c35477bb3d Fuse input streams on creation. 2020-09-23 19:21:49 -04:00
Nick Mathewson 6492334aff Turn IdMap into an extension trait.
Also, use the "right" (cyclic, potentially expensive) algorithm for
stream IDs.
2020-09-23 17:53:58 -04:00
Nick Mathewson bf7672cb77 A few tests for tor-linkspec 2020-09-23 16:47:37 -04:00
Nick Mathewson 49829b49b7 Tests (and correctness fixes) for protover. 2020-09-22 22:39:01 -04:00
Nick Mathewson 06a39719c5 Add tests for SignatureGated 2020-09-22 20:50:35 -04:00
Nick Mathewson e592fff4a2 Tests for Timerangebound. 2020-09-22 20:37:08 -04:00
Nick Mathewson 7130d87d7c Run cargo fix --edition-idioms 2020-09-21 13:50:47 -04:00
Nick Mathewson 0c131dc080 Run cargo upgrade 2020-09-21 13:45:36 -04:00
Nick Mathewson d96a949cb3 Update documentation 2020-09-21 13:43:58 -04:00
Nick Mathewson d5d11d6923 Update TODO file 2020-09-21 13:14:21 -04:00
Nick Mathewson 3eb087bf16 turn hopnum into a first-class type 2020-09-21 12:56:30 -04:00
Nick Mathewson c276cfcb73 Add is_zero for ID types. 2020-09-21 12:27:45 -04:00
Nick Mathewson fb7703f7e9 Fix some errors; document some places where error handling is bogus 2020-09-21 12:22:35 -04:00
Nick Mathewson 68fc1b0f4d More documentation for channel, circuit, stream. 2020-09-21 12:10:51 -04:00
Nick Mathewson bc00417f01 Start implementing streams and circuit-level reactors.
Also, revise nearly all of the circuit/channel interaction to
actually send relay cells to the right place and do sensible things
with them.
2020-09-21 10:42:36 -04:00
Nick Mathewson 296bfbe57b Add RelayCmd::accepts_streamid_val 2020-09-20 14:09:10 -04:00
Nick Mathewson 9567689a30 Refactor accetps_circid_val to be less wonky. 2020-09-20 14:09:10 -04:00
Nick Mathewson a3384bc126 Move is_recognized function into caret. 2020-09-20 14:09:10 -04:00
Nick Mathewson a547cda19f Rename StreamCmd to RelayCmd 2020-09-20 14:09:10 -04:00
Nick Mathewson c6d403472f Improve shutdown support for channel. No idea if it works. 2020-09-20 14:09:10 -04:00
Nick Mathewson 9c4685968c rename a field in RelayCell 2020-09-20 14:09:10 -04:00