Commit Graph

7920 Commits

Author SHA1 Message Date
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
Nick Mathewson 988556dbef Create a StreamID->Stream map type.
Also extract the shared part of CircMap and StreamMap into a new
IdMap type.
2020-09-20 14:09:10 -04:00
Nick Mathewson 0075b784a1 De-parameterize channel and circuit
By putting the cell-sink in a box, we can get rid of the need for
having everything that uses a channel or a circuit know what kind
of underlying TLS implementation it has.
2020-09-19 22:29:18 -04:00
Nick Mathewson 56d8bc1756 Add tests for CREATE_FAST handshake 2020-09-19 13:06:40 -04:00
Nick Mathewson 80d1d27810 Add tests for failing ntor handshakes. 2020-09-19 12:37:17 -04:00
Nick Mathewson 389fc03e1e ntor: test the ClientHandshake/ServerHandshake impl 2020-09-18 21:20:22 -04:00
Nick Mathewson 3907e4a0c9 tests for kdf functions in tor_proto 2020-09-18 20:57:56 -04:00
Nick Mathewson 69e1c91ba1 Add tests for tor_proto::util::ct 2020-09-18 20:00:06 -04:00
Nick Mathewson 5f54be2234 Give up on suppressing that nightly-only clippy warning 2020-09-18 19:28:55 -04:00
Nick Mathewson 5e1e77a363 Make consensus documents valid DistDelay seconds earlier.
This will prevent arti from hitting the same issue as
https://gitlab.torproject.org/tpo/core/tor/-/issues/25756
2020-09-18 19:24:06 -04:00
Nick Mathewson 6a2c803f98 Resolve some nightly-only clippy warnings 2020-09-17 19:13:56 -04:00
Nick Mathewson eb24b6f019 Fix a panic bug in microdesc parsing.
Found by fuzzing!  The issue was that we were relying on the
arguments slice being within the input string, but we were sometimes
using a different _empty_ slice when there were no arguments.

I've noted a better solution in a comment.
2020-09-17 19:07:38 -04:00
Nick Mathewson 91db8ab6fb Add fuzzers for certs, netdoc, and proto.
This was remarkably simple.
2020-09-17 19:06:56 -04:00
Nick Mathewson f256847f82 Sort linkspecs in the same order as tor does 2020-09-17 15:33:18 -04:00
Nick Mathewson ba546a798d use more correct expiration times 2020-09-17 15:19:12 -04:00
Nick Mathewson e3a524a659 More tests for tor_bytes::impl 2020-09-15 11:39:09 -04:00
Nick Mathewson 94792f583b tor_bytes: Remove an extraneous println 2020-09-15 11:26:44 -04:00
Nick Mathewson af7052657e bytes: add tests for impl.rs 2020-09-15 11:06:58 -04:00
Nick Mathewson 054a5e5582 bytes: add tests for Writer trait 2020-09-14 18:25:50 -04:00
Nick Mathewson 294f2a5241 bytes: more test for Reader. 2020-09-14 18:05:47 -04:00
Nick Mathewson 963ab969cf Add test for failing RSA identity construction 2020-09-13 17:44:34 -04:00
Nick Mathewson 41ca4eb154 Add some test vectors for rsa, taken from chutney 2020-09-13 17:39:01 -04:00
Nick Mathewson 9a94f11938 Now that the rsa crate has pkcs1 decoding, use it.
Also, instead of implementing an otherwise-derivable Hash for rsa
public keys, tell clippy not to worry that we're defining
partialeq but not hash.
2020-09-13 17:37:11 -04:00
Nick Mathewson 3d5f8cfec5 update wishlist: the rsa crate now supports oaep 2020-09-13 13:05:07 -04:00
Nick Mathewson dcc155027d stop exposing rsa::errors::Result. 2020-09-13 13:04:19 -04:00
Nick Mathewson fe5a05497f Add unit test for ValidatableEd25519Signature 2020-09-13 12:41:59 -04:00
Nick Mathewson b3acc7f90f caret tests: Test debug output for caret_enum 2020-09-13 12:24:53 -04:00
Nick Mathewson 2040db71d0 Add test vectors for curve25519->ed25519 parts of llcrypto
Also add a terminating NUL byte to a derivation string, to ensure
that our results match Tor's results.  (This does not actually serve
a purpose FWICT.)
2020-09-13 12:10:56 -04:00
Nick Mathewson 6c4944ab3e llcrypto: Fix a bug in ed25519->curve25519 secret key conversion
We were taking the sign bit from the _secret_ key, which is totally
incorrect.  Instead it needs to be taken from the _public_ key.

Additionally, add a unit test for ed25519->curve25519 code.
2020-09-13 12:10:56 -04:00
Nick Mathewson 8fee269f94 llcrypto: tests for rsa kludge 2020-09-13 12:10:56 -04:00
Nick Mathewson 4fde455717 More tests for caret_int. 2020-09-13 09:19:12 -04:00
Nick Mathewson 624a70d22b yet more readme updtes 2020-09-13 08:49:59 -04:00
Nick Mathewson d4281b110e Add documentation for tor-netdir crate 2020-09-13 08:27:55 -04:00
Nick Mathewson 3ef7f2bb3d more readme tweaks 2020-09-12 21:47:55 -04:00
Nick Mathewson c52bcfd1d7 Explain the demo in the readme. 2020-09-12 21:46:32 -04:00
Nick Mathewson ee9b871bc5 Make client-demo launch a request to www.torproject.org:80 2020-09-12 21:32:00 -04:00
Nick Mathewson 02fc8b2528 Implement extend2/extended2 handshake.
This is not a production-ready implementation: it will break if a
circuit is used for anything while an extend is pending.

Client-demo can now build 3-hop circuits.
2020-09-12 20:48:07 -04:00
Nick Mathewson df0ebf857f Make more types implement Debug. 2020-09-12 20:45:59 -04:00
Nick Mathewson 7a72e093f4 tor_bytes::Reader: fix a bug in truncate. 2020-09-12 20:44:57 -04:00
Nick Mathewson a9181131d2 Fix a bug in encoding extend2 cells. 2020-09-12 20:44:25 -04:00
Nick Mathewson dc287d4457 WIP: extend. 2020-09-12 17:01:15 -04:00
Nick Mathewson d1039dda9b Simple functions to send and receive relay cells. 2020-09-12 16:25:10 -04:00
Nick Mathewson 3e342a69ae Add a function to pad relay cells. 2020-09-12 15:55:04 -04:00