summaryrefslogtreecommitdiff
path: root/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an enumeration for destroy reasons.Nick Mathewson2020-10-191-3/+2
|
* Improvements to Relay type in tor-netdir.Nick Mathewson2020-10-191-1/+1
| | | | | | | | | | | Now, a Relay is always valid. This required some changes to the API: all_relays() has to return a new UncheckedRelay type that might or might not be valid, and the functions on Relay and ChanTarget that return ed25519 identities need to return an Ed25519Identity, not an ed25519::PublicKey. This change required some new encoding/decoding/conversion functions on Ed25519Identity.
* Mark must-resolve XXXX issues with "XXXXM3".Nick Mathewson2020-10-188-34/+30
| | | | | | | | | | "M3" is for "milestone 3" -- my target to fix the technical debt that I think will be bad if we ship even a pre-alpha with it. These aren't necessarily _all_ must-resolve, but they're all must-look-at. Closes #15
* tor-proto: Add a ClientCircChanMsg type.Nick Mathewson2020-10-155-22/+43
| | | | | | 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.
* tor-proto: Add a "CreateResponse" type.Nick Mathewson2020-10-155-15/+64
| | | | | | 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.
* Run "cargo upgrade".Nick Mathewson2020-10-151-2/+2
|
* Fix a couple of clippy warningsNick Mathewson2020-10-152-2/+2
|
* Turn the channel's ref to its circmap into a Weak referenceNick Mathewson2020-10-151-6/+11
| | | | | This way, when the channel reactor is dropped, the circuit map can get dropped too, which will cause reading circuits to notice.
* Mark channels as unusable if reactor gets an error.Nick Mathewson2020-10-153-1/+31
| | | | | Similarly as with circuits, we want this code to set a "closed" flag so that attempts to write on the channel will fail.
* Use weak references from circuit reactor to circimpl.Nick Mathewson2020-10-142-15/+30
| | | | This prevents the reactor from keeping the circuit alive forever.
* Use a weak reference from channel reactor to channel.Nick Mathewson2020-10-141-5/+7
|
* Send DESTROY cells when a circuit is dropped.Nick Mathewson2020-10-143-27/+161
| | | | | | | | | 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.
* Revise DropMark defense to use a better type and match Tor's behavior.Nick Mathewson2020-10-135-12/+97
|
* Document all private members in tor-protoNick Mathewson2020-10-1314-7/+131
|
* Make sure that protocol errors terminate the circuit responsible.Nick Mathewson2020-10-132-20/+55
|
* Improve handling of circuit closure or failure on reactor shutdown.Nick Mathewson2020-10-132-4/+35
| | | | | | | | | | 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.
* Another tweak to handling closing streamsNick Mathewson2020-10-133-14/+40
| | | | | | 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.
* Try giving distinct handling to streams where END has been sentNick Mathewson2020-10-125-51/+114
| | | | | | 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
* Tweak terminate hand handle_close() functions.Nick Mathewson2020-10-112-13/+20
| | | | | These need to become functions about terminating and noticing a termination request.
* Rename StreamMap::Closing to EndReceivedNick Mathewson2020-10-111-4/+4
| | | | This is in preparation for adding a different EndSent stream state.
* Fix a pair of bugs in SENDME handling.Nick Mathewson2020-10-091-13/+10
| | | | | | | | | 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.
* Move counts_towards_windows() code into circuit moduleNick Mathewson2020-10-094-4/+19
|
* Split information about circuit hops into inbound and outbound.Nick Mathewson2020-10-092-61/+172
| | | | | | | | | | | | | | | | | | 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.
* Split client relay crypto into separate directionsNick Mathewson2020-10-093-77/+179
| | | | | I think we should have the reactor task own the reverse crypto and the circuit own the forward crypto.
* Use batch verification in client<->relay handshake.Nick Mathewson2020-10-021-7/+19
|
* Enable batch ed25519 verification.Nick Mathewson2020-10-021-0/+1
|
* cargo upgradeNick Mathewson2020-09-291-1/+1
|
* Move RelayCell into a more reasonable place.Nick Mathewson2020-09-292-4/+4
|
* Remove idmap as needlessly complex.Nick Mathewson2020-09-294-52/+39
|
* make it work on rust 1.45Nick Mathewson2020-09-281-1/+1
|
* test vectors for cell crypto.Nick Mathewson2020-09-283-3/+61
|
* Mark most of the cell crypto code as crate-local.Nick Mathewson2020-09-281-7/+7
|
* Add a round-trip test for cell encryption.Nick Mathewson2020-09-281-0/+74
|
* Rename remaining get_ accessorsNick Mathewson2020-09-287-40/+33
|
* tor_cert: rename accessorsNick Mathewson2020-09-281-3/+3
|
* Rename some identifiers in tor-linkspec.Nick Mathewson2020-09-282-12/+12
| | | | By convention, rust accessor functions don't start with 'get'.
* Rename ExtendTarget to CircTarget.Nick Mathewson2020-09-281-2/+2
|
* Fix a few clippy issuesNick Mathewson2020-09-271-1/+3
|
* Fix some comments that reflected a misunderstanding in SENDMEsNick Mathewson2020-09-262-3/+3
| | | | | I had thought that the sendme authentication things used for onion services were 32-byte; they're still only 20.
* Split the cell-handling parts of tor-proto into a new crate.Nick Mathewson2020-09-2622-2251/+76
|
* Make sendme authentication optional.Nick Mathewson2020-09-254-15/+43
| | | | | | | 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.
* Lower our "#[allow(dead_code)]" decl in tor_proto."Nick Mathewson2020-09-257-1/+6
|
* Improve documentation and lightly refactor SENDME codeNick Mathewson2020-09-255-49/+119
|
* Implement authenticated sendme output for circuit-level sendmes.Nick Mathewson2020-09-253-6/+44
| | | | This patch has a XXXXX kludge note in it.
* Add a bad workaround for a deadlock: we should look for a better one.Nick Mathewson2020-09-252-4/+14
|
* Fix encoding/decoding of authenticated sendme.Nick Mathewson2020-09-251-4/+22
|
* Try to get sendme crypto workingNick Mathewson2020-09-253-27/+62
| | | | | | | | 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.
* Incomplete implementation of circuit SENDME handling.Nick Mathewson2020-09-255-26/+86
| | | | | | 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.
* Attempted implementation of stream sendme cellsNick Mathewson2020-09-256-26/+100
|
* Initial work on a sendme backend.Nick Mathewson2020-09-252-0/+152
| | | | | Parameterized for authenticated/unauthenticated operation, and operation on circuits and streams.