Commit Graph

568 Commits

Author SHA1 Message Date
Nick Mathewson 0bd6d62951 tor-linkspec: remove a completed TODO 2020-10-18 17:03:11 -04:00
Nick Mathewson 311d060037 Remove a comment about a spec clarification
This was fixed as torspec#30
2020-10-18 16:59:45 -04:00
Nick Mathewson 5f4eff6338 Resolve XXXX items in tor-cert crate. 2020-10-18 16:54:51 -04:00
Nick Mathewson 1abd93d696 Clarify kludgey magic in our to_der() function. 2020-10-18 16:50:40 -04:00
Nick Mathewson bc8a32f618 List supported/unsupported subprotocols in the README 2020-10-18 15:59:45 -04:00
Nick Mathewson 353a4bfb87 Cleanup from prop315 implementation.
Most of the fixes here are just removing comments that said "this
isn't technically required but I'm going to pretend it is".

I also made the "protocols" field in microdescs out of its Option<>,
since we're now requiring that.
2020-10-16 16:36:51 -04:00
Nick Mathewson 7a4c1e87ea Implement proposal 315: make various directory fields required 2020-10-16 16:30:40 -04:00
Nick Mathewson 471ada89bb Update TODO 2020-10-15 14:48:35 -04:00
Nick Mathewson 5173ee960f tor-proto: Add a ClientCircChanMsg type.
This wraps exactly the ChanMsg values that are valid on open client
circuits, so that we can be sure that only those cells are sent to a
ClientCirc's reactor.
2020-10-15 14:23:12 -04:00
Nick Mathewson 34962c3c9f tor-proto: Add a "CreateResponse" type.
CreateResponse includes exactly those cells that are a correct
response to a CREATE2/CREATE_FAST, so we can be sure that only those
cells are actually passed to a PendingClientCirc.
2020-10-15 14:09:19 -04:00
Nick Mathewson 3408c9ad26 Run "cargo upgrade". 2020-10-15 13:32:02 -04:00
Nick Mathewson 13ecfa2786 Mark item done in todo 2020-10-15 12:57:34 -04:00
Nick Mathewson 6f75b82ef3 Use Ed25519Identity in microdescriptors. 2020-10-15 12:42:09 -04:00
Nick Mathewson c00f1671a2 Add an (unchecked) Ed25519Identity type
This type differs from ed25519::PublicKey in that it is _not_
checked or expanded.
2020-10-15 12:15:51 -04:00
Nick Mathewson 85151085ec llcrypto: Move ed25519 module into its own file. 2020-10-15 11:45:06 -04:00
Nick Mathewson ae19caed7d Fix a couple of clippy warnings 2020-10-15 08:36:04 -04:00
Nick Mathewson 22f260872b Turn the channel's ref to its circmap into a Weak reference
This way, when the channel reactor is dropped, the circuit map
can get dropped too, which will cause reading circuits to notice.
2020-10-15 08:30:46 -04:00
Nick Mathewson 5c70790701 Mark channels as unusable if reactor gets an error.
Similarly as with circuits, we want this code to set a "closed" flag
so that attempts to write on the channel will fail.
2020-10-15 07:38:03 -04:00
Nick Mathewson 691eab53d6 Use weak references from circuit reactor to circimpl.
This prevents the reactor from keeping the circuit alive forever.
2020-10-14 14:30:48 -04:00
Nick Mathewson 4646a4546e Use a weak reference from channel reactor to channel. 2020-10-14 14:21:02 -04:00
Nick Mathewson ffe605aa52 Send DESTROY cells when a circuit is dropped.
This reuses a lot of mechanism from the circuit code that sends END
cells when streams are dropped.

There is a problem here: Circuits and channels won't actually get
dropped, because we should be using a weak reference from the
reactor.
2020-10-14 14:17:08 -04:00
Nick Mathewson 6a937cedc8 TODO: Add and link tickets for Milestone 3 items 2020-10-13 13:46:55 -04:00
Nick Mathewson 328fa994fb Revise TODO and README; declare "milestone 2" done.
Part of this "declaring milestone 2 done" business is a matter of
putting additional tests and documentation into milestone 3 where
they logically belong.
2020-10-13 13:01:33 -04:00
Nick Mathewson 1085ca86dc Revise DropMark defense to use a better type and match Tor's behavior. 2020-10-13 11:52:05 -04:00
Nick Mathewson 3d597a10bc Document all private members in tor-proto 2020-10-13 10:55:07 -04:00
Nick Mathewson b2007b7082 Make sure that protocol errors terminate the circuit responsible. 2020-10-13 10:14:01 -04:00
Nick Mathewson 6b0e3efbd0 Improve handling of circuit closure or failure on reactor shutdown.
We already handled the case okay when we were reading on streams,
since the reactor's going away would drop the sender side of their
mpsc channels.  But if the reactor went away, nothing would tell
_writing_ streams that they needed to close.

Now we handle that case, as well as anybody who is waiting on
a meta-cell to get back to them.
2020-10-13 09:26:23 -04:00
Nick Mathewson 119ff0abba Another tweak to handling closing streams
When a stream is closed and we haven't adjusted its state in the
stream map yet, remember how many cells we've dropped so we can
decrement them from the window later on.
2020-10-13 08:52:01 -04:00
Nick Mathewson c12aed3d0d Try giving distinct handling to streams where END has been sent
This is the first step along the line to handling Tor issue
tor#27557.  We want to remember streams that we've ended and treat
them as distinct from streams that have never existed
2020-10-12 11:36:17 -04:00
Nick Mathewson 74624e6250 Tweak terminate hand handle_close() functions.
These need to become functions about terminating and noticing a
termination request.
2020-10-11 15:25:06 -04:00
Nick Mathewson 1a406b8fe9 Rename StreamMap::Closing to EndReceived
This is in preparation for adding a different EndSent stream state.
2020-10-11 14:49:50 -04:00
Nick Mathewson a1855699ef Test the pick_weighted function in tor-netdir 2020-10-10 17:36:15 -04:00
Nick Mathewson 6b2ba9a16c Document remaining private members of tor-netdoc. 2020-10-10 16:41:43 -04:00
Nick Mathewson f8fde02c0b Document most private items in tor-netdoc. 2020-10-09 18:02:02 -04:00
Nick Mathewson 3631b2bfdc Document all the private items in tor-cell
Also, change the type of the authentication challenge to be an
array; it isn't in fact variable-length.
2020-10-09 17:28:57 -04:00
Nick Mathewson 2247664abe Remove a couple of allow(unused) notations 2020-10-09 16:47:59 -04:00
Nick Mathewson cb0b115a7e mark off a TODO item. 2020-10-09 16:43:23 -04:00
Nick Mathewson 40eb26e1a7 Fix a pair of bugs in SENDME handling.
The problem is that we would count begin and end cells towards
towards window totals when we are only supposed to count DATA
cells, *and* that we would we send our sendmes one cell too early
(or maybe late?).

Closes #1.
2020-10-09 15:23:26 -04:00
Nick Mathewson b3a809b1e3 Move counts_towards_windows() code into circuit module 2020-10-09 15:07:12 -04:00
Nick Mathewson 68b969773a client-main: Add an option to run a test more than once 2020-10-09 13:10:31 -04:00
Nick Mathewson fe3c79d0d1 add point estimates to TODO 2020-10-09 11:37:45 -04:00
Nick Mathewson 15564bd1b2 check off the deadlock in the todo. 2020-10-09 11:31:03 -04:00
Nick Mathewson 569eff88c4 Split information about circuit hops into inbound and outbound.
Previously the circuit object owned not only the outbound crypto,
but also the inbound crypto and the stream maps.  That's not so
great, since the reactor needs to use the inbound crypto and the
stream maps all the time, whereas the circuit doesn't need them much
(or at all).

Moving these objects to the reactor-owned structure should let us
fix the deadlock case in stream sendme handling, since the circuit
reactor no longer needs to lock the circuit in order to do crypto
and demultiplexing.  It should also speed up the code a bit, since
it doesn't need to grab the circuit lock nearly so often as before.

This change forced me to add a couple of new reactor CtrlMsg values,
since the circuit can no longer add streams and layers directly.  I
think it will still be a performance win, though.
2020-10-09 11:28:09 -04:00
Nick Mathewson 5a8300f0f4 Split client relay crypto into separate directions
I think we should have the reactor task own the reverse crypto and
the circuit own the forward crypto.
2020-10-09 11:28:09 -04:00
Nick Mathewson dfa5e08a33 client-demo:Be louder on reactor failure. 2020-10-09 11:27:52 -04:00
Nick Mathewson 800948c4cb Fix counting rules for circuit-level sendmes. 2020-10-09 11:27:27 -04:00
Nick Mathewson cf882d5a6d Logic error: negate test for sendme cells in counts_towards_windows 2020-10-09 10:11:23 -04:00
Nick Mathewson f2ec2c68e0 Expose --flood and --dl switches on client-demo
These are for testing sendmes.
2020-10-09 09:37:46 -04:00
Nick Mathewson b845d37b3b Add routerdesc examples 2020-10-07 13:48:31 -04:00
Nick Mathewson b3e2086c7b netdoc: more tests for routerdesc parsing 2020-10-07 13:19:17 -04:00