Commit Graph

585 Commits

Author SHA1 Message Date
Nick Mathewson 0df0cf4250 proto: Create a `DataStreamCtrl` type.
The idea here is that we want to make DataStream visible to the
RPC system without requiring that the RPC session hold the
DataStream itself (or the Reader, or the Writer).  We could solve
this problem by making _all_ the state in the DataStream shared,
but that would introduce unnecessary extra locking in our critical
path.

Instead we're creating the notion of a "control handle" that lets
you manage and observe a stream without actually owning the stream.

Right now the only supported functionality is asking for the
stream's circuit.

Part of #847
2023-05-22 11:27:44 -04:00
Nick Mathewson 0765412fc8 proto: Add a new experimental stream-ctrl feature.
(It doesn't do anything yet. It may eventually become always-on.
But for now let's make this API optional.  Part of #847)
2023-05-22 09:07:03 -04:00
Nick Mathewson b55a3ade33 tor-proto: Move a comment in Cargo.toml 2023-05-22 09:04:44 -04:00
Nick Mathewson f333c9029a Merge branch 'virtual_hop' into 'main'
tor-proto: Add support for extending circuits through virtual hops.

Closes #726

See merge request tpo/core/arti!1191
2023-05-18 17:14:01 +00:00
Nick Mathewson 6f80caed9d proto: Explain "virtual" hops better.
Based on text from @diziet
2023-05-18 12:40:02 -04:00
Nick Mathewson 0230e7bccc proto: Try to improve the documentation in crypto/cell.rs 2023-05-18 12:40:02 -04:00
Nick Mathewson 3b7a20ef4c proto: Allow circuit Paths to represent virtual hops.
Sadly, this adds a few more `TODO HS` entries, but I think we can
clean them up later after a bit of discussion.
2023-05-18 12:40:02 -04:00
Nick Mathewson 663f25d44c proto: Implement Circuit::extend_virtual.
There are a few new TODO hs comments, though, and an XXXX I'll need
to fix up in the next commit.

Implements #726.
2023-05-18 12:40:02 -04:00
Nick Mathewson b9a848a7ac tor-proto: Code to construct crypto layers for virtual hops.
This is fairly straightforward, thanks to our existing design work
on this code.
2023-05-18 12:40:02 -04:00
eta 4665835ee8 tor-guardmgr, tor-proto: minor logging tweaks
- We make the tor-guardmgr "We have found that {} is usable" line
  include the word "guard", otherwise it doesn't appear very useful to a
  user in safe logging mode, since the guard gets replaced with
  [scrubbed].
- The "Actually got an end cell..." message is downgraded to DEBUG.
2023-05-18 16:04:11 +01:00
Nick Mathewson d008c385d5 hs_ntor: several documentation cleanups. 2023-05-17 16:18:55 -04:00
Nick Mathewson 954b41dcf1 hs_ntor: make encrypt_and_mac take a typed public key
This is still not the most beautiful interface, but it'll do for now.
2023-05-17 16:18:55 -04:00
Nick Mathewson 50ce084d64 hs_ntor: remove the last lingering AsRef<[u8]> 2023-05-17 16:18:55 -04:00
Nick Mathewson a6fd8fb347 hs_ntor: Add a test vector case extracted from C tor. 2023-05-17 16:18:55 -04:00
Nick Mathewson 20d6c4b247 hs_ntor: Calculate MAC on introduce1 message correctly.
There were two bugs here that made the behavior unlike that of C
tor: we had swapped the MAC inputs, and we had forgotten to include
the public key X in the input.
2023-05-17 16:18:55 -04:00
Nick Mathewson 1f665d1144 hs_ntor: Make internal no-rng variants of the handshake functions.
We'll want these so we can implement some test vectors.
2023-05-17 16:18:55 -04:00
Nick Mathewson ceaeb61168 hs_ntor: Move extra data outside of the "input" fields.
I think that these Input structs had been defined so that we could
use hs_ntor interchangeably with other handshakes.  The trouble is,
though, that it doesn't really work like any other handshakes we
have.
2023-05-17 16:18:55 -04:00
Nick Mathewson 54665c2b65 hs_ntor: Use MAC implementation from tor-hscrypto
Note that some of the invocations for this function seem to put the
key and the message in a questionable order.  But that's a thing to
figure out later, while debugging.
2023-05-17 16:18:55 -04:00
Nick Mathewson c8ad9450c2 hs_ntor: Use correct PK types from tor_hscrypto. 2023-05-17 16:18:55 -04:00
Nick Mathewson 9d5dd813c0 hs_ntor: Use Subcredential type from tor-hscrypto 2023-05-17 16:18:55 -04:00
gabi-250 fb8bc19b9b Merge branch 'arc_circ' into 'main'
Refactor ClientCirc APIs to use Arc<ClientCirc>.

Closes #846

See merge request tpo/core/arti!1187
2023-05-17 09:47:19 +00:00
Nick Mathewson b84f122aab Merge branch 'ticket_759' into 'main'
tor-cert: Replace the KeyUnknownCert::check_key API

Closes #759

See merge request tpo/core/arti!1184
2023-05-16 22:23:17 +00:00
Nick Mathewson 56c6e4345b Replace usage of KeyUnknownCert::check_key. 2023-05-16 17:53:15 -04:00
Nick Mathewson ee390c423e Refactor ClientCirc APIs to use Arc<ClientCirc>.
Now ClientCirc is no longer `Clone`, and the things that need it
to be `Clone` instead return and use an Arc<ClientCirc>
We're doing this so that ClientCirc can participate in the RPC
system, and so that its semantics are more obvious.

Closes #846.

Thanks to the type system, this was a much simpler refactoring than
I had feared it would be.
2023-05-16 09:02:09 -04:00
Nick Mathewson 6fa821238d Revise all XXXXs from fixup-features 2023-05-15 11:00:28 -04:00
Nick Mathewson 4b08ef76a0 Run fixup-features _with_ annotations.
This litters our Cargo.toml files with "XXX" entries that we should
fix.
2023-05-15 10:41:32 -04:00
Nick Mathewson e2e125fef7 Reformat Cargo.toml files. 2023-05-15 09:09:43 -04:00
Nick Mathewson 7a5373c110 Run fixup-features --no-annotate for initial Cargo.toml fixes.
This does the following:
  - Gives every crate a `full`.
  - Cause every `full` to depend on `full` from the lower-level
    crates.
  - Makes every feature listed _directly_ in `experimental` depend
    on `__is_experimental`.
2023-05-15 09:07:21 -04:00
Nick Mathewson bfda3082d4 Use non-deprecated *Secret::random_from_rng.
The `new` function is deprecated in x25519-dalek 2.0.0-rc.2
2023-05-13 16:52:23 -04:00
Nick Mathewson 7ce808b75b Change CircTarget::linkspecs() to return an encoded list.
If we didn't do this, we would need to transfrom
`EncodedLinkSpec`s into a `LinkSpec::Unrecognized`, which is not
semantically right.  What's more, every user of this API wants to
consume encoded link specifiers, so encoding them early saves a
little effort.
2023-05-10 12:30:32 -04:00
Nick Mathewson e845a553f3 Upgrade tracing to 0.1.36.
This is the first version to impl Value for String.

With luck, this will get minimal_versions CI passing.
2023-05-03 11:09:21 -04:00
Nick Mathewson 1904cfc8b9 Increment crate versions.
Because of the errorkind bumps, we're calling this a breaking change
in everything lower-level than `arti`.

Generated with:
```
cargo set-version -p tor-basic-utils --bump minor
cargo set-version -p tor-async-utils --bump minor
cargo set-version -p caret --bump minor
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p safelog --bump minor
cargo set-version -p retry-error --bump minor
cargo set-version -p tor-error --bump minor
cargo set-version -p tor-config --bump minor
cargo set-version -p tor-events --bump minor
cargo set-version -p tor-units --bump minor
cargo set-version -p tor-rtcompat --bump minor
cargo set-version -p tor-rtmock --bump minor
cargo set-version -p tor-rpcbase --bump minor
cargo set-version -p tor-llcrypto --bump minor
cargo set-version -p tor-protover --bump minor
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-hscrypto --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-checkable --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-linkspec --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-proto --bump minor
cargo set-version -p tor-netdoc --bump minor
cargo set-version -p tor-consdiff --bump minor
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-congestion --bump minor
cargo set-version -p tor-persist --bump minor
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-ptmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump minor
cargo set-version -p tor-dirclient --bump minor
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p tor-hsclient --bump minor
cargo set-version -p tor-hsservice --bump minor
cargo set-version -p arti-client --bump minor
cargo set-version -p arti-rpcserver --bump minor
cargo set-version -p arti-config --bump minor
cargo set-version -p arti-hyper --bump minor

cargo set-version -p arti --bump patch
cargo set-version -p arti-bench --bump patch
cargo set-version -p arti-testing --bump patch
```
2023-05-03 08:31:11 -04:00
Nick Mathewson 5cd5e6a3f8 async-utils: rename SinkExt to SinkPrepareExt 2023-04-19 12:38:26 -04:00
Nick Mathewson 4efb423947 Upgrade our hex-literal dependency 2023-04-13 07:51:26 -04:00
Nick Mathewson 3f269449cb tor-proto: Be explicit about an into().
This is a workaround for an issue that I'm about to encounter
somewhere in our pile of dependencies as I add arti-rpcserver, and
somehow make serde_json visible in this test code thereby, making
the PartialEq method resolution ambiguous.
2023-04-12 07:34:57 -04:00
Nick Mathewson 104d64589d Increment MSRV to 1.65 in every crate. 2023-04-11 15:31:12 -04:00
Nick Mathewson 2ab5348ab2 Remove semver.md files. 2023-03-31 09:24:41 -04:00
Nick Mathewson 9ef115a7fb Patchlevel bumps for crates whose dependencies just changed.
These crates had no changes until just a moment ago. But since
we updated the versions on some of their dependents, they have now
changed themselves.  Thus they get patchlevel bumps.

```
tor-rtmock
tor-protover
tor-socksproto
tor-consdiff
tor-chanmgr
tor-dirclient
tor-hsservice
```
2023-03-31 08:30:14 -04:00
Nick Mathewson e208fb15ad Bump crate versions that have breaking changes
These crates have had breaking changes.  They are pre-1.0, so they get
a minor bump.

```
tor-basic-utils
tor-config
```
2023-03-31 08:28:06 -04:00
Nick Mathewson a81ab391ae Bump patchlevel on crates with non-breaking changes
For these crates, the changes are nontrivial, so we
_do_ bump the versions on which their dependent crates depend.

Fortunately, since they are all pre-1.0, we don't need to
distinguish semver-additions from other changes.  (Except for arti,
which _is_ post-1.0, but gets a patchlevel bump anyway.)

These are unstable crates with breaking changes:

```
tor-hscrypto
tor-hsclient
```

These have new or extended APIs:

```
safelog
tor-bytes
tor-cell
tor-linkspec
tor-llcrypto
tor-proto
tor-cert
arti-client
```

These have new unstable APIs or features:
```
tor-netdoc
tor-circmgr (also broke some unstable APIs)
arti (is post-1.0)
```

These have bugfixes only:
```
caret
tor-dirmgr
```
2023-03-31 08:24:39 -04:00
Nick Mathewson a62affd66e Move functionality from tor_basic_utils to tor_async_utils
This commit is mostly code movement; I'd recommend reviewing it
with git's `--color-moved` option.
2023-03-29 13:57:11 -04:00
Ian Jackson 00e522a91a Add some missing imports
Now
  nailing-cargo +stable clippy -p tor-hsclient --all-features --all-targets
actually works.

squash! Add some missing imports
2023-03-28 15:49:45 +01:00
Nick Mathewson a7b238483e Add an experimental circuit accessor to DataStream.
Closes #784.
2023-03-23 09:18:42 -04:00
Ian Jackson b834535347 tor-proto: Feature-conditionalise some enum variants
This avoids some dead code warnings when building without send-control-msg.
2023-03-23 11:50:18 +00:00
Ian Jackson 93809cc594 tor-proto: Split off send-control-msg feature 2023-03-23 11:50:18 +00:00
Nick Mathewson 0521aa855e tor-proto: document deep-copy in ClientCirc::path() 2023-03-22 12:35:41 -04:00
Nick Mathewson bb47d42315 proto: Stabilize ClientCirc::n_hops. 2023-03-22 11:52:17 -04:00
Nick Mathewson 552acbf07f Fix a bunch of needless-conversion warnings.
Apparently 1.68 now warns when you call into_iter() on something
that's already an iterator.  Fair enough.  Let's stop doing that.
2023-03-10 07:09:50 -05:00
Nick Mathewson f3b8f4f73f tor-proto: Document limitation on send_control_message 2023-03-08 14:21:33 -05:00
Nick Mathewson c1b45e1be4 tor-proto: Say "control message" a little more consistently
(I found "user request" in one place, and fixed that.  I am not
currently going to try to unify "control message" and "meta message"
since both terms are misleading and we already have TODOs to try to
merge them into a third better term.)
2023-03-08 14:21:33 -05:00
Nick Mathewson 9c4bdb8d8d tor-proto: Make send_control_message wait for the reactor.
This way we don't need to worry about race conditions that happen if
the caller thinks that the handler is installed before it really is.
2023-03-08 14:21:33 -05:00
Nick Mathewson fc31bf4e25 tor-proto: Have send_control_message install a handler, not return a stream 2023-03-08 14:21:33 -05:00
Nick Mathewson bc83d1e1de tor-proto: Implement functionality to send a message and accept replies
This new function combines "sending a message" and "accepting
replies in a stream" into a single call, so that there is no gap
between when the message is sent and the replies are available.

There are a number of compromises here, in order to avoid API
proliferation. I've tried to contain them as best I can.

See comments for additional design discussion.
2023-03-08 14:21:33 -05:00
Nick Mathewson 094fdc0d8d tor-proto: Change semantics of MetaCellHandler
Now, the MetaCellHandler is responsible for consuming the messages
it gets, and reporting status to whatever task is waiting for a
status message.

Additionally, the MetaCellHandler can decide to remain installed or
shut down the circuit after a successful message.  (Previously, it
could only uninstall itself on success and kill the circuit on
failure.)

These changes will enable MetaCellHandlers to be used as the basis
for handling more kinds of message.

(There is some moved and reformatted code here; you may want to
review it with `git {diff or show} --color-moved -b`.)
2023-03-08 14:21:33 -05:00
Nick Mathewson 7108f923e0 tor-proto: Give Path a method to access final hop num. 2023-03-08 14:21:33 -05:00
Nick Mathewson 5586a29f62 tor-proto: Give circ Reactor a constructor, and make its fields private. 2023-03-08 14:21:33 -05:00
Nick Mathewson f41449d0bd Patchlevel bumps for remaining changed crates.
These crates have had small code changes, but no API additions:

tor-config
tor-socksproto
tor-cert
tor-chanmgr
tor-ptmgr
tor-guardmgr
tor-circmgr
tor-dirclient
tor-dirmgr
arti
tor-hsservice
tor-congestion

These crates have had API extensions:

fs-mistrust
tor-llcrypto
tor-bytes
tor-checkable
tor-linkspec
tor-netdoc
tor-persist
arti-client
2023-02-28 07:13:27 -05:00
Nick Mathewson 3e1ae65212 Bump tor-units version for breaking change.
(The breaking change was removing `as_days()` from IntegerMinutes.)

We are _not_ calling this a downstream-api breaking change, per
discussion at
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012?commit_id=bb2ab7c2a3e0994bb438188511688b5b039cae29#note_2876819
2023-02-28 07:10:00 -05:00
Nick Mathewson 3e257a7cb5 Bump minor versions for significant breaking changes.
This includes tor-cell, tor-proto, and tor-netdir.
2023-02-28 07:05:15 -05:00
Ian Jackson f63c7c48af Rename onion-* cargo features to hs-* in tor-* crates
Fixes #756
2023-02-28 11:10:17 +00:00
Nick Mathewson 07473ed1fc proto: Tweak documentation and names around CmdChecker. 2023-02-27 08:14:15 -05:00
Nick Mathewson 814563dfd6 tor-proto: Rename end_received.
It can now indicate _any_ cell that means we can forget about a stream.
2023-02-17 11:56:53 -05:00
Nick Mathewson d81a9c9aad Use CmdChecker in our stream handling code.
This change makes sure that open streams and half-closed streams
have the same stream-type-dependent state machines with respect to
which cells are acceptable.

Fixes #774.

Fixes #769.
2023-02-17 11:52:09 -05:00
Nick Mathewson c5be3c089e tor-proto: Introduce CmdChecker, and define it for our streams.
The role of CmdChecker is to verify that messages are arriving at
the appropriate sequence on a stream, with respect to the other
messages that have been received.  Once the stream becomes
half-closed, the CmdChecker is also in charge of consuming incoming
messages on the stream and making sure that they are well-formed.
2023-02-17 11:50:27 -05:00
Nick Mathewson 19c0dd153a tor-proto: Add a TODO about simplifying a common pattern. 2023-02-15 10:51:03 -05:00
Nick Mathewson 1ee6bfa59c tor-proto: note implications for future HS work 2023-02-15 10:48:19 -05:00
Nick Mathewson 41b50b6c56 tor-proto: Push stream message parsing into the stream objects.
This closes #525, and ensures, at last, that we don't parse any
message that we wouldn't accept.
2023-02-15 10:48:19 -05:00
Nick Mathewson 58c3b8276c tor-proto: Defer parsing of messages send to half-closed streams
This includes a partial solution for #769, but also turned up
another bug (#774) while I was working on it.  I'll close them both
once I have a real solution.
2023-02-15 10:48:19 -05:00
Nick Mathewson bd0f6f5adf tor-proto: stop reactor (and kill circuit) if meta handler fails
If the meta handler reports an error, then the circuit has violated
its protocol, and needs to be shut down.

Fixes #773.
2023-02-15 10:48:19 -05:00
Nick Mathewson 2e483124cb tor-proto: defer meta-cell parsing to the last moment. 2023-02-15 10:48:19 -05:00
Nick Mathewson 0765243f5e tor-proto: Use UnparsedRelayCell to start deferring cell processing.
In general, we want to avoid parsing these cells until we are
fairly sure that they are something we would accept.
2023-02-15 10:48:19 -05:00
Nick Mathewson ca3b33a1af tor-cell: Refactor relay cells to copy much less
We now manipulate raw relay cell bodies as (an alias for)
`Box<[u8;509]>` rather than as (an alias for) `[u8;509]`.  This
enables us to do much less copying.  It will become more important
soon, as we defer parsing relay cell bodies even longer.

Related to #7.

We also use SliceWriter to avoid allocating a Vec<> for every relay
message we want to encode, and instead encode directly into the
cell.
2023-02-15 10:48:19 -05:00
Nick Mathewson 0d772e5bed Rename OpenClientChan{Msg,Cell} => OpenChan{Msg,Cell}S2C 2023-02-09 10:20:31 -05:00
Nick Mathewson b7490ce374 tor-proto: Do not parse forbidden commands on inbound cells.
Unlike C tor, we treat unrecognized commands as reason to kill off
the connection entirely.  That's fine; if we need to add an
unrecognized command in the future, we can use VERSIONS to negotiate
it.

Also, if someday we want this code to support relay channels as
well, we can use some type trickery to have that work too.
2023-02-09 10:20:31 -05:00
Nick Mathewson b49bd3b121 tor-proto: only parse allowed ChanMsg types during handshake. 2023-02-09 10:20:31 -05:00
Nick Mathewson 16b9d23a7c tor-cell: Make RelayEarly a separate type.
This allows us to remove a shenanigan from `restricted_msg!{}`.
2023-02-09 10:20:28 -05:00
Nick Mathewson e832cbd29c tor-cell: Have restrict_msg add conversion functions.
Every FooMsg type now implements Into<AnyFooMsg>, and
TryFrom<FooMsg>.

Additionally, it now implements From<X> for every distinct type that
it supports.  This last part lets us discard a bunch of code.

Unfortunately, I needed some downright hackish trickery in order to
get these macros to avoid generating `From<AnyFooMsg> for AnyFooMsg`
and conflicting with the blanket implementation.

The trickery to deal with RelayEarly and Relay being the same type
was not necessarily worth it; I will be separating them and removing
said trickery in the next commit.
2023-02-09 10:20:11 -05:00
Nick Mathewson d63d7926bd tor-cell: Rename RelayMsg and RelayCell-related types.
Thanks to rust-analyzer for making this simple.
2023-02-07 16:03:14 -05:00
Nick Mathewson d99c130679 tor-cell: Rename ChanMsg and ChanCell-related types. 2023-02-07 16:03:14 -05:00
Nick Mathewson c529bb9c30 tor-cell: Remove RelayMsg methods that are duplicated in RelayMsgClass. 2023-02-07 16:03:14 -05:00
Nick Mathewson 3c7aea723b tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass. 2023-02-07 16:03:14 -05:00
Nick Mathewson 71445f7ace tor-cell: Use macro to generate ChanMsg too. 2023-02-07 16:03:14 -05:00
Nick Mathewson ffb443709b tor-cell: Change all variants of RelayMsg to have a body.
Previously, there were some unit variants, but that makes things
quite awkward for #525.
2023-02-07 16:03:14 -05:00
Nick Mathewson a2b1f20216 Bump minor version of tor-cell.
In !948 we renamed a couple of accessor functions, which is a
breaking change in `tor-cell`'s API.

In retrospect, perhaps we should have deprecated the old names and
added the new ones, so we wouldn't have to break the API.  (This is
the only API break AFAICT since 1.1.0.)
2023-02-01 10:42:58 -05:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
These changes influence behavior, but not effect compatibility.
(If I messed up, and any crate except for `arti` has non-breaking
API changes, that's still fine, since they are all version
0.x.)
2023-02-01 10:23:58 -05:00
Nick Mathewson c42350c6bf Move tor-proto/semver.md to tor-cell
It was erroneously created in the wrong place.
2023-02-01 09:50:02 -05:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
eta cd7059f5c7 Merge branch 'sensitive' into 'main'
tor-proto: Mark stream ids in errors as sensitive

See merge request tpo/core/arti!986
2023-01-26 11:31:46 +00:00
Ian Jackson 590c139af9 tor-proto: Mark stream ids in errors as sensitive
Pursuant to #556
2023-01-24 18:08:40 +00:00
Nick Mathewson ce293e4ce4 tor-proto: comment fixes and more TODO hs 2023-01-24 11:50:10 -05:00
Nick Mathewson 12845d6e1e tor-proto: Draft API to handle incoming BEGIN requests.
Onion services (and later, exits and caches) will need this.
2023-01-17 15:20:03 -05:00
Nick Mathewson e8ed46006e tor-proto: Expose support for doing onion service handshakes
This is a little tricky, but I think that we're not actually
exposing too much here.  I expect we'll need to tweak this stuff
between now and our final version.
2023-01-17 15:20:03 -05:00
Nick Mathewson 99fdaa7c2e tor-proto: Draft APIs for handling control messages
We will need these for onion services, to send and receive messages
of types not handled directly by the tor-proto crate.
2023-01-17 15:20:03 -05:00
Nick Mathewson 4fedd301cf tor-proto: Rename "hs" experimental feature to "onion-common"
(For consistency with other crates)
2023-01-17 15:20:03 -05:00
Dimitris Apostolou 892c6eaadf
Fix typos 2023-01-07 20:35:54 +02:00
Ian Jackson 98acafe9d1 tor-proto: rustfmt
Not sure why the tree didn't have this newline already.  "Whatever".
2023-01-06 17:26:54 +00:00
Ian Jackson 0639b105c5 tor-proto: CreateFastWrap::decode_chanmsg: Do not report handshake
The debug impl prints the handshake challenge, which we should
probably treat as sensitive.
2023-01-06 17:26:54 +00:00
Ian Jackson df2124e28f tor-proto: impl Display for CreateResponse
Don't print the handshake value, but do print the display reason.
2023-01-06 17:26:54 +00:00
Ian Jackson 8c925499f8 tor-proto: When relay IDs mismatch, the IDs are sensitive in errors 2023-01-06 17:26:54 +00:00
eta 118050e54c Merge branch 'test-lints' into 'main'
Add test lint blocks to all "mod test"

See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
Ian Jackson 8f91bc5ef9 Merge branch 'tor-proto-use-rfc3339' into 'main'
Use parse_rfc3339() in the tor-proto crate

See merge request tpo/core/arti!942
2023-01-04 14:31:07 +00:00
Neel Chauhan e39e39ea27 Add semver.md for (into_)handshake() 2022-12-19 08:25:15 -08:00
Neel Chauhan b649a1d86f msg::{CreateFast/CreatedFast}: Rename accessor to (into_)body() 2022-12-18 21:00:24 -08:00
Neel Chauhan c171c0f834 Use parse_rfc3339() in the tor-proto crate 2022-12-16 12:53:50 -08:00
Ian Jackson fa5a417fc9 Merge branch 'err-dyn-report' into 'main'
Error logging (ErrorReport, .report()) POC

See merge request tpo/core/arti!936
2022-12-15 15:02:17 +00:00
Ian Jackson 125a455bdc test lint blocks: Add many many automatically
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Ian Jackson baf78361e8 test lint blocks: Do some semi-manually
This is the hunks from running the rune in maint/adhoc-add-lint-blocks
but which require some subsequent manual fixup: usually, deleting
now-superfluous outer allows, but in some cases manually putting back
lints that the adhoc script deleted.
2022-12-12 18:00:29 +00:00
coral 25f113b8b3 Tackling issue #663 (Use humantime in tests) 2022-12-12 17:41:22 +00:00
Ian Jackson 8fea4dd6d3 tor-proto: reactor tests: Use debug fmt on an error
In tests, debug fmt is usually appropriate.

Found while looking for a candidate for
  https://gitlab.torproject.org/tpo/core/arti/-/issues/680
2022-12-12 16:40:51 +00:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson d51162e55b Fix a bunch of "needless borrow" warnings on nightly
It looks like, despite a few false starts, they've got this warning
right; there weren't any false positives.
2022-11-18 10:12:05 -05:00
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
Nick Mathewson 932fe48eaf Run add_warnings. 2022-11-03 11:06:02 -04:00
Nick Mathewson 49f0521904 Merge branch 'rename_for_to_from' into 'main'
tor-cell: Rename for_client and for_relay

See merge request tpo/core/arti!793
2022-10-25 11:53:57 +00:00
Nick Mathewson 1195c40a99 linkspec: Remove now-useless declared_peer_addr
The singleton variation here is almost never what we want.
2022-10-24 08:59:12 -04:00
Emil Engler e5429a2891
tor-cell: Rename for_client and for_relay
This commit renames the for_client and for_relay functions to
from_client and from_relay respectively, in order to indicate their
origin, as the term "for" is more likely to indicate a destination,
which is not true in that situation.
2022-10-21 13:21:52 +02:00
Nick Mathewson 61a33da0ff proto: Make Channel::reparameterize take &self.
Even though channels are practically changeable, they use locks
internally so that you don't need a `&mut Channel` to send or
receive traffic.  It makes sense for reparameterizing the channel to
also use a &self reference.

I'll need this so that I can store channels in an `ByRelayIds<>`
set, and still invoke their reparameterize methods.
2022-10-18 11:49:21 -04:00
Nick Mathewson 96493f427d proto: Implement HasRelayIds for Channel. 2022-10-18 11:49:21 -04:00
Ian Jackson f84d8777db cargo fmt to remove blank lines
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.

This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson d9910dba08 Replace all README copies in src/lib.rs with includes
The feature we want is `#[doc = include_str!("README.md")]`, which is
stable since 1.54 and our MSRV is now 1.56.

This commit is precisely the result of the following Perl rune:
  perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
2022-10-12 15:29:03 +01:00
Ian Jackson 82ad9eea5f Allow "clippy::single_char_pattern" in tests.
This lint exists for perf reasons, and this is rarely relevant in
tests.

Using double quoted str is generally cognitively less burdensome.
2022-10-12 13:50:29 +01:00
Nick Mathewson 74d4c73d09 Change multiplicity of ChannelMethod and addresses
Now each `ChanTarget` has at most one `ChannelMethod`, and only
`Direct` `ChannelMethods` can have multiple addresses.

Closes #600.
2022-10-11 08:53:31 -04:00
Nick Mathewson 22b14066f0 Clarify limits on socket address from ChannelMethod 2022-10-06 15:13:05 -04:00
Nick Mathewson 299ebd729d tor-linkspec: Remove the old OwnedFoo::new() functions
These are now builders.
2022-10-06 15:13:05 -04:00
Nick Mathewson 34c9178feb tor-proto: Preserve the ChannelMethod, not the SocketAddr 2022-10-06 15:13:05 -04:00
Nick Mathewson 102e3c221d Bump minor version of tor-rtcompat and most of its dependents
(Since the APIs for the `Schedule::sleep*` functions changed, this
is a breaking change in tor-rtcompat.  Therefore, the Runtime trait
in tor-rtcompat is now a different trait.  Therefore, anything that
uses the Runtime trait in its APIs has also broken.)
2022-10-03 10:01:46 -04:00
Nick Mathewson 388e0cbab5 Bump crates that have had backward compatible API changes. 2022-10-03 09:52:34 -04:00
trinity-1686a 8e7a904260 fix clippy::needless_borrow 2022-09-10 14:39:47 +02:00
Nick Mathewson a5f704f443 Remove semver.md from arti-1.0.0 2022-09-07 09:17:00 -04:00
Nick Mathewson 96875ea208 Bump crate versions in preparation for Arti 1.0.0 release.
Because we want to work more on ensuring that our semver stability
story is solid, we are _not_ bumping arti-client to 1.0.0 right now.

Here are the bumps we _are_ doing.  Crates with "minor" bumps have
had API breaks; crates with "patch" bumps have had new APIs added.

Note that `tor-congestion` is not bumped here: it's a new crate, and
hasn't been published before.

```
tor-basic-utils         minor
fs-mistrust             minor
tor-config              minor
tor-rtcompat            minor
tor-rtmock              minor
tor-llcrypto            patch
tor-bytes               patch
tor-linkspec            minor
tor-cell                minor
tor-proto               minor
tor-netdoc              patch
tor-netdir              minor
tor-persist             patch
tor-chanmgr             minor
tor-guardmgr            minor
tor-circmgr             minor
tor-dirmgr              minor
arti-client             minor
arti-hyper              minor
arti                    major
arti-bench              minor
arti-testing            minor
```
2022-09-01 08:59:49 -04:00
Nick Mathewson 8b6f4cc69d Update README.md files with "readmes" tool. 2022-08-31 11:08:03 -04:00
Nick Mathewson 79860041fe Upgrade statrs in preparation for release. 2022-08-30 20:09:19 -04:00
trinity-1686a 426a59b2ba add feature annotation not added by doc_auto_cfg 2022-08-24 18:22:41 +02:00
trinity-1686a 7f939fa480 enable doc_auto_cfg feature on every crate when documenting for docs.rs 2022-08-24 18:22:41 +02:00
Ian Jackson d4ce701fa4 channel padding: Only do anything with link protocol 5
Or rather, if we *didn't* negotiate 4, which is too old.

As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
2022-08-17 10:54:41 +01:00
Ian Jackson 08a7257fe9 channel padding: Properly advertise link protocol 5
We already actually send and negotiate the padding, since !657,
but we ought to negotiate a protocol version where that's not a
violation!

As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
2022-08-17 10:54:41 +01:00
Ian Jackson 8339558ba8 channel padding: Move initial config of ChannelPaddingInstructions
Making ChannelPaddingInstructions::default() accurately reflect the
initial state of the reactor's padding timer simplifies the code
somewhat.

(When padding is wanted, parameters are computed and inserted
explicitly, so the only change is that if we start out dormant, we
defer setting the timer parameters until necessary.)

As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
2022-08-17 10:54:41 +01:00
Ian Jackson 8a484a26e6 channel padding: Parameters: default_padding replaces Default impl
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
2022-08-17 10:54:41 +01:00
Ian Jackson d9338293c8 Add semver notes 2022-08-17 10:54:41 +01:00
Ian Jackson 4111c63bd4 channel reactor: Add some commented-out debug for padding 2022-08-17 10:54:41 +01:00
Ian Jackson 46885ac14b channel padding: Correctly always send the timer parameters
Fixes "chanmgr configuration: Avoid sending needless initial update(s)"
2022-08-17 10:54:41 +01:00
Ian Jackson 496563e7cf channel padding: Abolish ARTI_EXPERIMENTAL_CHANNEL_PADDING env var
This was for testing and is no longer needed.
2022-08-17 10:54:41 +01:00
Ian Jackson 299f302f35 channel engage_padding_activities: swap docs to tor0proto
This allow us to make a working cross-reference.
2022-08-17 10:54:41 +01:00
Ian Jackson 88dc816770 channel fake_channel_details: Use precise cfg
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826169
2022-08-17 10:54:41 +01:00
Ian Jackson 52848a41c6 ChannelPaddingInstructions: Update and expand docs 2022-08-17 10:54:41 +01:00
Ian Jackson 2a4fd97229 ChannelPaddingInstructions: Rename `params` field to `insns` 2022-08-17 10:54:41 +01:00
Ian Jackson 949e5395e0 Rename ChannelsParams types to ChannelPaddingInstructions (fmt)
Run rustfmt; no other changes.
2022-08-17 10:54:41 +01:00
Ian Jackson 94dd3361e2 Rename ChannelsParams types to ChannelPaddingInstructions
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826167

This makes some lines too long; I will run rustfmt in a separate
commit for clarity.
2022-08-17 10:54:41 +01:00
Ian Jackson 2404357282 Rename PaddingParameters::all_zeroes constructor to disabled 2022-08-17 10:54:41 +01:00
Ian Jackson 03d8a09c0e Channel: Make mutable() and engage_padding_activities infallible
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826151

This gets rid of quite some Bug error paths.
2022-08-17 10:54:41 +01:00
Ian Jackson 5db974ef72 Move ChannelUsage from tor_proto to tor_chanmgr
Replace Channel::note_usage with Channel::engage_padding_activities,
which unconditionally causes the channel to (start to) do netflow
padding things.

The condition now lives in chanmgr.

Addresses
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
2022-08-17 10:54:41 +01:00
Ian Jackson 4cf418f421 tor-cell: PaddingNegotiate::default_reduced
Get rid of unneeded constructor.

We never need to use hardcoded reduced padding parameters during
negotiation cell construction.  If we are using reduced padding
parameters, the layers which decide this have netparams to use.

Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826092
2022-08-17 10:54:41 +01:00
Ian Jackson 14c6e17797 tor-cell: PaddingNegotiate::start: take IntegerMilliseconds 2022-08-17 10:54:41 +01:00
Ian Jackson 6fdaca8eb9 channel: Clarify (and in some places replace) "frontend" terminology 2022-08-17 10:54:41 +01:00
Ian Jackson 481bf0bbe9 tor-proto channel padding: Document PADDING_NEGOTIATE overwriting
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2825979
2022-08-17 10:54:41 +01:00
Ian Jackson 36e3529e34 chanmgr ChannelUsage: Fix and clarify docs 2022-08-17 10:54:41 +01:00
Ian Jackson 7ed983800d channel padding: Rename low_ms and high_ms
These have the unit in the type.  Putting that in the field name too
is otiose.
2022-08-17 10:54:41 +01:00
Ian Jackson 7ae60c229b tor-proto, testing: Provide accessors for ChannelsParamsUpdates 2022-08-16 18:43:23 +01:00
Ian Jackson 9310ee2930 tor-proto, testing: Provide new_fake_channel
To test the padding control we will want this.
2022-08-16 18:43:23 +01:00
Ian Jackson 182b9775bb tor-proto, testing: Make fake_channel_details available
Now it's not just cfg(test), but feature testing.
2022-08-16 18:43:23 +01:00
Ian Jackson db3fafb0d4 tor-proto: Make "testing" feature that exports some things
We are going to want this for through-the-layers padding control
testing.
2022-08-16 18:43:23 +01:00
Ian Jackson 50ca64218e channel padding: Send negotiation cells 2022-08-16 18:43:23 +01:00
Ian Jackson 0a1bffb047 tor-proto channel: Make arrangements to send PADDING_NEGOTIATE
This is actually a general facility for inserting locally-generated
cells into the outgoing stream.

It doesn't seem to be possible to do this without adding an additional
condition check to the reactor, since we need to insert it into the
right place in the stream, giving it priority over data, and only
using it up if there was room in the output.

We don't engage this machinery yet, because nothing sets
special_outgoing.
2022-08-16 18:43:23 +01:00
Ian Jackson d8972e2cde chanmgr configuration: Avoid sending needless initial update(s)
Change ChannelsParams::initial_update to compare fields with their
default values, and, if they're the same as the default, not to
include them in the returned update.

And if that update is then empty, return None.

The overall effect is to avoid the call to chan.reparameterize if
we're using the builtin default parameters, which is usual.
2022-08-16 18:43:23 +01:00
Ian Jackson 582430d1ac channel: Use channel usage to control channel padding
We introduce the per-channel state that is used to keep track of
channel usage, and defer padding setup until it's wanted.
2022-08-16 18:39:57 +01:00
Ian Jackson d407ef93ee channel: Provide somewhere for the frontend's mutable state
Right now this is just furniture.  We're going to put channel padding
control state here.
2022-08-16 18:37:06 +01:00
Ian Jackson 8d44ef05dc Provide ChannelUsage and plumb it all the way down
Channel padding depends on what the channel is being used for.  We
therefore need to let the channel code know this information.

The implementation of the per-channel padding control logic will be in
the new note_usage function, which for now is simply a stub.

A future commit will introduce a `PaddingControlState` which lives in
the channel frontend; consult the doc comment for that type to see why
the plumbing through the channel manager terminates in the channel
frontend.
2022-08-16 18:37:06 +01:00
Ian Jackson 61ab684f74 channel reparameterize: Change error type
This is going to be able to fail in other ways too, sadly.
2022-08-16 18:37:06 +01:00
Ian Jackson 6d16e3f947 channel params: ChannelsParamssUpdates: provide combine()
We're going to need this because the frontend is going to need to
defer some channel padding parameters updates.
2022-08-16 18:37:06 +01:00
Ian Jackson d1b7c06e0a channel params: Add a missing comma.
Unfortunately, because we don't have derive-adhoc here yet, rustfmt
didn't get to notice that this comma was needed.

We are going to add field(s), so add the comma now.
2022-08-16 18:37:06 +01:00
Ian Jackson cc731cef49 channel params: Rename initial_update (from total_update)
The semantics of this are going to become a bit more subtle.
2022-08-16 18:37:06 +01:00
Ian Jackson 35c8c3cd1b tor-proto: padding::Parameters: Provide all_zeroes
This exists so that we handle this case specially, as we will need to,
and so that we can represent disablement in a Parameters.
2022-08-16 18:37:06 +01:00
Ian Jackson e8a6cb62c4 tor-proto: padding::Parameters::padding_negotiate_cell
The channel manager is going to use this as part of constructing the
right cell for padding neogotiattion.
2022-08-16 18:37:06 +01:00
Ian Jackson 7843a09c90 tor-proto: padding::Parameters: Provide default_reduced constructor
We're going to want this so that we can do reduced padding.
2022-08-16 18:37:06 +01:00
Ian Jackson b417075f11 channel padding: Add doc commentary with the channel padding plan
Much of this does not exist yet.  It will do by the end of this
branch.

Expand a doc note for ChannelsParamsUpdates too.
2022-08-16 18:37:06 +01:00
Ian Jackson b2df8755a4 channel: Centralise Channel::send_control
Replaces 4 open-coded call sites.

I am going to add one more.
2022-08-16 18:37:06 +01:00
Ian Jackson 806828c01c tor-proto: padding::Parameters: use impl_standard_builder
This is more standard.  It also provides the ::build() method.

This isn't a config type, and build failures ought not to happen,
so we use Bug for the error.
2022-08-16 18:37:06 +01:00
Nick Mathewson 192a48c496 tor-proto: Add a comment about the tor-proto layer.
We want to clarify that the tor-proto crate should only know _how_
its objects behave, not _why they behave that way_.  (In other
words, we can have a "padding strategy" setting on a channel, but
not a "general usage" setting.)

Closes #531.
2022-08-10 12:13:01 -04:00
Nick Mathewson 71242f1500 Clarify that tor-proto _does_ create timers. 2022-08-10 12:02:46 -04:00
Nick Mathewson 36a28a8587 Merge branch 'main' into 'linkspec_refactor_v3'
# Conflicts:
#   crates/tor-netdir/semver.md
2022-08-10 14:48:57 +00:00
Nick Mathewson 19079c5a7d tor-proto: Unify the check_match code in channel and handshake
This had to become a new internal function, since at the point that
the handshake needs this code, it does not yet have a Channel to use.

This change made the error messages in the handshake code more
informative: and now they require a regex to check.  Later, we might
want to defer formatting these strings, but I don't think we need
to do it now.
2022-08-10 10:39:47 -04:00
Nick Mathewson 2d4507ff35 Final (?) API revisions for tor-linkspec
With this change, each individual identity type becomes optional.
The functions that expose them unconditionally are now in a "legacy"
trait that only some downstream types are expected to implement.

There are new convenience APIs in HasRelayIds:
  * to return Option<&keytype>,
  * to see if one identity-set contains another.

This commit will break several downstream crates!  For the
reviewer's convenience, I will put the fixes for those crates into a
series of squash! commits on this one.

tor-netdir
----------

Revise tor-netdir to accept optional identities.  This required some
caveats and workarounds about the cases where we have to deal with a
key type that the tor-netdir code does not currently recognize at
all.  If we start to add more identity types in the future, we may
well want more internal indices in this code.

tor-proto
---------

In order to make tor-proto support optional identities, there were
fewer changes than I thought.  Some "check" functions needed to start
looking at "all the ids we want" rather than at "the two known IDs";
they also needed to accommodate that case where we don't have an ID
that we demand.

This change will also help with bridges, since we want to be able to
connect to a bridge without knowing all of its IDs up front.

The protocol currently _requires_ the two current ID types in some
places. To deal with that, I added a new `MissingId` error.

I also removed a couple of unconditional identity accessors for
chanmgr; code should use `target().identity(...)` instead.

tor-chanmgr
-----------

This is an incomplete conversion: it does not at all handle channel
targets without Ed25519 identities yet.  It still uses those
identities to index its internal map from identity to channel; but
it gives a new `MissingId` error type if it's given a channel target
that doesn't have one.

We'll want to revise the map type again down the road when we
implement bridges, but I'd rather not step on the channel-padding
work in progress right now.

tor-guardmgr
------------

This change is mostly a matter of constructing owned identity types
more sensibly, rather than unwrapping them directly.

There are some places marked with TODOs where we still depend on
particular identity types, because of how the directory protocol
works.  This will need revisiting when we add bridge support here.

tor-circmgr
-----------

These changes are just relatively simple API changes in the tests.
2022-08-10 10:39:37 -04:00
Nick Mathewson e3cc533853 Merge branch 'zeroize' into 'main'
Revise our handling of the zeroize trait

Closes #254

See merge request tpo/core/arti!655
2022-08-04 14:54:21 +00:00
Ian Jackson d523ad495a Merge branch 'inc-rename' into 'main'
Rename `.inc` and other included files to end in `.rs`

Closes #381

See merge request tpo/core/arti!645
2022-08-02 16:48:49 +00:00
Nick Mathewson b68a3ed5e5 tor-linkspec: Refactor out traits to represent a relay's ID set.
We want the set of identities supported by a relay to be extensible
in the future with minimal fuss; we'd also like to make working
with these ID sets more convenient.  To handle that, this commit
adds a new trait for "Something that has the same IDs as a relay"
and a new object for "an owned representation of a relay's IDs."

This commit introduces a similar trait for "Something with a list of
SocketAddr, like a relay has."  There's no owned equivelent for
that, since Vec<SocketAddr> is already a thing.

Closes #428.
2022-08-02 12:40:23 -04:00
Nick Mathewson 1eb8b02f47 Remove some testing-only reimplementations of OwnedChanTarget.
These predate OwnedChanTarget, and are no longer needed.
2022-08-02 12:39:30 -04:00
Nick Mathewson 37e6c95fdc tor-proto: Use correct SecretBuf in handshakes.
Everything that is a secret encryption key, or an input that is used
to produce a secret encryption key, has to get zeroized.  And that's
all!

Closes #254.
2022-08-01 15:41:22 -04:00
Nick Mathewson eedd63d5e9 tor-proto: Replace SecretBytes with SecretBuf.
This does not yet make sure that `SecretBuf` is used where it
_should_ be, but at least it ensures that most uses of `SecretBytes`
will indeed act as intended, and make sure that whatever they
contain is zeroized.

It requires some corresponding changes to method calls for
correctness and type conformance.
2022-08-01 15:41:22 -04:00
Nick Mathewson 514c3a8e62 Use the `zeroize` feature in several crates
Using `zeroize` here tells these crates that they should make
various structures zeroize-on-drop.

(This is not yet implemented in `aes` 0.8.1, but support has been
merged in the repository for `aes`, so it should go out in the next
release.)

No corresponding feature flag is needed to enable zeroize-on-drop
for `rsa` and `*25519-dalek` private keys.
2022-08-01 12:13:05 -04:00
Nick Mathewson b16c042004 Now that versions have bumped, remove semver.md files. 2022-08-01 10:07:12 -04:00
Nick Mathewson 859ae4acd0 Bump patch versions on crates that have new APIs.
Do _not_ bump the dependency versions on crates that have had no
changes since arti 0.0.5, since those crates do not depend on the
new APIs.

```
cargo set-version -p tor-basic-utils   --bump patch
cargo set-version -p tor-llcrypto      --bump patch
git restore crates/tor-checkable
git restore crates/tor-consdiff
git restore crates/tor-rtmock
```
2022-08-01 09:56:29 -04:00
Nick Mathewson 511cb46997 Bump minor version on crates with deps with breaking changes.
This performs the transitive closure of the last operation:
everything that depends on a crate with a breaking change gets the
version which it depends on bumped.

```
cargo set-version -p tor-proto         --bump minor
cargo set-version -p tor-netdoc        --bump minor
cargo set-version -p arti-hyper        --bump minor
cargo set-version -p arti-bench        --bump minor
cargo set-version -p arti-testing      --bump minor
cargo set-version -p tor-config        --bump minor
```
2022-08-01 09:49:13 -04:00
Nick Mathewson f5dcb98f06 Bump minor versions on all crates that have had breaking changes.
Done with these commands:

```
cargo set-version -p fs-mistrust       --bump minor
cargo set-version -p tor-bytes         --bump minor
cargo set-version -p tor-socksproto    --bump minor
cargo set-version -p tor-cert          --bump minor
cargo set-version -p tor-linkspec      --bump minor
cargo set-version -p tor-cell          --bump minor
cargo set-version -p tor-netdir        --bump minor
cargo set-version -p tor-persist       --bump minor
cargo set-version -p tor-chanmgr       --bump minor
cargo set-version -p tor-guardmgr      --bump minor
cargo set-version -p tor-circmgr       --bump minor
cargo set-version -p tor-dirclient     --bump minor
cargo set-version -p tor-dirmgr        --bump minor
cargo set-version -p arti-client       --bump minor
cargo set-version -p arti              --bump minor
```
2022-08-01 09:43:09 -04:00
eta f02d732b7f Rename `.inc` and other included files to end in `.rs`
In order to mitigate syntax highlighting issues and a rust-analyzer bug
(https://github.com/rust-analyzer/rust-analyzer/issues/10178), rename
files that are included with the `include!` macro to have a `.rs`
extension.

Make sure the included files are outside `src/`, in order to not confuse
humans and automated editing tools that might mistake them for valid
Rust modules.

fixes arti#381
2022-07-26 15:09:28 +01:00
trinity-1686a 8c28622ecb change usage of PublicKey to Ed25519 in tor-cert
and propagate to other affected crates
2022-07-23 20:07:25 +02:00
trinity-1686a 8def416144 change check_key to take a Option<&_> instead of &Option<_> 2022-07-23 18:38:31 +02:00
Nick Mathewson fbb6484025 tor-proto: Stop using write_infallible in handshake code.
This change was a bit annoying, since most of this code _can't_ fail,
and so the only reasonable response is to wrap the input in an
internal error... except for one case where we're actually encoding
a caller-provided message, so we _do_ want to wrap the EncodeError
from tor_bytes.
2022-07-11 11:18:51 -04:00