| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Because the API assumes that many writes are infallible, this writer
takes ownership of the backing object, and will only return it to
you if you didn't run over the end.
I'm going to use this to save some allocations in relay cell bodies
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
Fuzzing for hsdesc parsers
See merge request tpo/core/arti!1018
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I've been running this for 5 minutes and haven't found any
crashes. I'll run it for an hour or two, then add the results to the
corpus repository.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We want to fuzz these parsers, but there's no currently way to get
at the parsers for inner documents without going through a lot of
encryption. (Coverage-guided fuzzers are powerful, but they
can't find SHA3 preimages.)
|
| |\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | | |
Upgrade to latest toml crate.
See merge request tpo/core/arti!1019
|
| |/ / /
| | |
| | |
| | | |
(None of the breaking changes affect us this time.)
|
| |/ / |
|
| |\ \
| | |
| | |
| | |
| | | |
Introduce new batching iterator and use it in two places
See merge request tpo/core/arti!1016
|
| | | | |
|
| | | |
| | |
| | |
| | | |
And another UNSTABLE warning.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
And explain why we're not using booleans.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1016#note_2877759
"_prefixed" becomes "_with_header". That mirrors the returned struct
which is nice.
|
| | | |
| | |
| | |
| | |
| | | |
Roughly as per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1016#note_2877822
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
This gets rid of a lot of manual boolean state variable iterator
stuff.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There will be two call sites to demonstrate it.
Eventually maybe this will want to be in tor-basic-utils, since it
doesn't depend on any of the tor-netdoc types. But it would be
sensible to wait until the situation with PeekableIterator and
Itertools is improved.
For now we make this #[doc(hidden)] to avoid it becoming part of our
stable API.
|
| | | |
| | |
| | |
| | |
| | | |
This will avoids some hairy borrowck disasters when we try to use
iterator adapters.
|
| | | |
| | |
| | |
| | | |
Not xure how my MR to try to do this everyone missed this one.
|
| | | |
| | |
| | |
| | | |
Not xure how my MR to try to do this everyone missed this one.
|
| |\ \ \
| |/ /
|/| |
| | |
| | | |
hsdesc: Add a test case for descriptors with ClientDescEncKey encryption.
See merge request tpo/core/arti!1015
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This one was generated (by dgoulet) using `ClientDescEncKey`
encryption. Its information is:
```
Address: paozpdhgz2okvc6kgbxvh2bnfsmt4xergrtcl4obkhopyvwxkpjzvoad.onion
Time period: 19397
Client:
paozpdhgz2okvc6kgbxvh2bnfsmt4xergrtcl4obkhopyvwxkpjzvoad:descriptor:x25519:SDZNMD4RP4SCH4EYTTUZPFRZINNFWAOPPKZ6BINZAC7LREV24RBQ
Service:
descriptor:x25519:SACGOAEODFGCYY22NYZV45ZESFPFLDGLMBWFACKEO34XGHASSAMQ
```
|
| |/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes an instance of #768.
The problem with the test vectors is that I used a random time
period number (1234) and the default-in-tor period length (1440)
without checking whether 1440 _meant_ minutes or seconds. I'll add
another test to Tor to make sure that the time period matches now.
With this change, I can test Tor-generated hsdescs with encryption,
so I'm fairly confident that the new behavior is correct.
|
| |\ \
| | |
| | |
| | |
| | | |
Apply restricted_msg to ChanMsg parts of tor-proto
See merge request tpo/core/arti!1013
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Actually, to avoid making a breaking change, I'm deprecating
BadMessage and creating a new InvalidMessage variant that takes a
Cow. This way I don't need to track every crate that re-exposes
tor_bytes::Error and call this a breaking change in those.
Making this change will allow tor_bytes errors to be much more
helpful.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
It's now redundant, since `restricted_msg!` defines From and Into
for us.
|
| | | |
| | |
| | |
| | | |
This allows us to remove a shenanigan from `restricted_msg!{}`.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change lets us use ChannelCodec to encode and decode any
restricted channel message type we want. (Later on, we'll turn the
related Codec class in tor-proto into a more type-restricted version
of this.)
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
Compute the HS directory hash ring
See merge request tpo/core/arti!1012
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012#note_2876824
|
| | | | | |
|
| | | | | |
|
| | | | | |
|