Commit Graph

7542 Commits

Author SHA1 Message Date
Nick Mathewson 31cde26138 main.rs: Add a flag for trace-level logs 2020-10-20 11:49:23 -04:00
Nick Mathewson 7ce158ed1e Add reasonable logging (I hope!) to channel 2020-10-20 11:45:53 -04:00
Nick Mathewson ebdd2c0318 Test new error type from caret 2020-10-19 18:25:16 -04:00
Nick Mathewson 1dc3fc214a Implement From, not Into.
These traits are inverses of one another, but implementing From is
always preferred since rust 1.41 relaxed the "orphan rules".
2020-10-19 17:40:43 -04:00
Nick Mathewson 16d8b267bc Resolve remaining XXXXM3 stuff in tor-cell 2020-10-19 14:36:31 -04:00
Nick Mathewson 88a012a9b0 Add assertions for overflow cases in relaycell::msg 2020-10-19 14:25:12 -04:00
Nick Mathewson 3d35f64742 Add assertions for overflow cases in chancell::msg 2020-10-19 14:22:59 -04:00
Nick Mathewson c7a2efe72b Add and use remaining CertType values in tor-cert 2020-10-19 14:17:25 -04:00
Nick Mathewson 2bd30f2db3 Use DestroyReason for Truncated messages. 2020-10-19 13:38:15 -04:00
Nick Mathewson e83d8ec3c2 Turn End reasons into a caret enumeration. 2020-10-19 13:31:46 -04:00
Nick Mathewson f2ebc94088 Add relay commands for circuit padding. 2020-10-19 13:30:36 -04:00
Nick Mathewson 378aa6d639 Add an enumeration for destroy reasons. 2020-10-19 13:13:55 -04:00
Nick Mathewson f3e1fafca2 Validate master-key-ed25519 field in routerdescs 2020-10-19 09:44:38 -04:00
Nick Mathewson 57637f3644 netdir: don't use relays with NoEdConsensus flag set. 2020-10-19 09:31:36 -04:00
Nick Mathewson 295a791a82 Improvements to Relay type in tor-netdir.
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.
2020-10-19 09:22:49 -04:00
Nick Mathewson 3798891b36 Calculate digest correctly when microdesc ends with base64 object. 2020-10-19 08:42:35 -04:00
Nick Mathewson df406f5319 Netdoc: validate objects even on unrecognized items. 2020-10-19 08:09:20 -04:00
Nick Mathewson 6f3d5d061d portpolicy: note a spec issue 2020-10-19 08:08:38 -04:00
Nick Mathewson 9d6d26d310 Explain problems with APIs in linkspec::traits. 2020-10-18 21:12:58 -04:00
Nick Mathewson 9c0d2ac20d Resolve XXXXM3 comments in caret crate 2020-10-18 20:34:38 -04:00
Nick Mathewson 5523134607 Mark must-resolve XXXX issues with "XXXXM3".
"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
2020-10-18 17:38:59 -04:00
Nick Mathewson 582cb945e4 More notes in README.md: assumed proposals, stability (non)guarantee 2020-10-18 17:38:28 -04:00
Nick Mathewson 32bfeb84eb Update microdesc parsing: ed25519 keys are no longer optional. 2020-10-18 17:12:47 -04:00
Nick Mathewson 32c2bc4bc1 Clarify TODOs in tor-protover 2020-10-18 17:06:15 -04:00
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