| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Adjust formatting, add more references to lower-level APIs, and
clarify lifetimes a little more.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, there was a bug in the way that our code used our SOCKS
implementations. If the buffer used for a SOCKS handshake became full
without completing the handshake, then rather than expanding the buffer
or closing the connection, our code would keep trying to read into the
zero-byte slice available in the full buffer forever, in a tight loop.
We're classifying this as a LOW-severity issue, since it is only
exploitable by pluggable transports (which are trusted) and by
local applications with access to the SOCKS port.
Closes #861.
Fixes TROVE-2023-001.
Reported-By: Jakob Lell <jakob AT srlabs DOT de>
|
| |
|
|
|
|
| |
I could also have stopped using `::default()` to construct this
(testing-only) object, but I think it makes more sense to turn it
into a non-unit object.
|
| |
|
|
| |
This fixes a warning from nightly clippy.
|
| |
|
|
|
|
| |
lifetime configurable.
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
We want to call ErrorReport::report() on Errors, but this isn't an
Error but only a string.
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Based on more temporary debugging code. Yet another part of #677.
|
| |
|
|
|
| |
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
|
| |\
| |
| |
| |
| |
| |
| | |
Renaming a couple of items for arti 1.1.0
Closes #623
See merge request tpo/core/arti!916
|
| | | |
|
| |/ |
|
| |\
| |
| |
| |
| | |
Separate BridgeAddr and PtTargetAddr
See merge request tpo/core/arti!904
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220
This commit is difficult to split up.
The innards of BridgeAddr and PtTargetAddr are still a bit entangled.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Resolve two bugs in our pt-socks implementation
Closes #676
See merge request tpo/core/arti!913
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
pt-spec says:
```
If the encoded argument list is less than 255 bytes in
length, the "PLEN" field must be set to "1" and the "PASSWD"
field must contain a single NUL character.
```
This is a very silly thing to say, but some PTs enforce it.
Fixes #676.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Our previous code would make a TCP connection to the proxy, then
wait forever for it to say something. Whoops!
Part of a fix for #676.
|
| | | | |
|
| | |/ |
|
| |/
|
|
|
|
| |
The comment says
// TODO pt-client: It's not clear to me that we really need this method.
and empirically, deleting it, and its callee, is fine.
|
| |\
| |
| |
| |
| | |
chanmgr: resolve several remaining "TODO pt-client" issues
See merge request tpo/core/arti!897
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
We were panicking if the PtMgr gave us an error, which isn't so
good.
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes the `ChanBuilder` type in `tor-chanmgr` usable by
consumers outside of that crate, like the doc comment for
`ChannelFactory` says you need to be able to do in order to turn your
`TransportHelper` into something useful.
As part of doing this, the `event_sender` its constructor takes needed
to be dealt with, since it was a crate-internal type that came from
inside the `ChanMgr`.
Enter `BootstrapReporter`: an opaque wrapper around that sender, now
provided as an additional argument to
`ChannelFactory::connect_via_transport`. You can now construct a
`ChanBuilder` outside this crate, and it'll still be able to report its
bootstrap status by unwrapping this new type that's threaded through
from the `ChanMgr`. (This was a fair deal of manually threading the type
through all the layers in this crate!)
Note that you cannot implement bootstrap updating using something that
isn't `ChanBuilder` yet due to the type being entirely opaque (but, of
course, we can figure out exactly what API the reporter should have
later, and add that capability in).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements `PtMgr`, a pluggable transport manager
responsible for keeping track of spawned PTs and spawning them to
satisfy client requests on demand.
It does this in two parts: the `PtMgr` type exported to the rest of the
code, and the background `PtReactor` that actually does the spawning;
this design ensures that only one attempt to spawn a PT is active at a
time, and will prove useful later for implementing e.g. timeouts.
A few changes were necessary to the rest of the code in order to make
this all work out. Namely:
- `TransportRegistry`'s API didn't make any sense for two reasons:
- It wasn't feasible for implementors to implement `ChannelFactory`,
since that'd require constructing a `ChanBuilder` (which requires a
bootstrap reporting event sender).
- Treating the PT manager as a registry is over-general; it's only
necessary for it to spawn pluggable transports, so saddling it with
other concerns didn't make any sense.
- (It's possible to get extensibility for arbitrary user customization
by just letting the user swap in a new `ChannelFactory`, anyway.)
- Therefore, the `PtMgr` implements the new `AbstractPtMgr` trait, which
is far more narrowly focused; this only exists to solve a dependency
loop, and is documented as such.
- This provides a `TransportHelper` instead of a `ChannelFactory`.
|
| |
|
|
|
|
|
|
|
| |
Enums with variants conditional on cargo features must be
non-exhaustive, because cargo features are supposed to be additive,
meaning that enabling a feature (which might happen due to some random
distant thing) ought not to break things using that enum.
There were surprisingly few places to fix this.
|
| |
|
|
|
|
|
|
|
|
|
| |
This
1. Makes the errors smaller (in the case of Io's PtTargetAddr;
ChannelBuild's addresses are already indirected in a Vec).
2. Redacts (currently, scrubs) the PtTargetAddr and SocketAddr
when safe logging is enabled
These are the remaining error variants in tor-chanmgr that contain
information that should become sensitive as part of bridge support.
|
| |
|
|
|
|
|
|
|
| |
This
1. Makes the errors smaller
2. Redacts (currently, scrubs) the chantarget when safe logging is enabled
This commit doesn't treat other should-be-sensitive inforemation in
errors just yet. That will come in a moment.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This commit makes it possible to replace the default channel factory
(used when there is no PtMgr), and to replace the PtMgr.
This is part of #659.
|
| |
|
|
|
|
| |
We will want the freedom to replace this, so it needs to go behind a
lock. We need to be able to Clone it cheaply now, so we're using an
Arc instead of a Box.
|
| |\
| |
| |
| | |
# Conflicts:
# crates/tor-chanmgr/src/factory.rs
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It doesn't make much sense to have the pluggable transport manager be a
registry, so replace its interface with a more narrowly defined, less generic
version.
Other changes:
- instead of returning a &-reference, it returns an owned Arc, which
should make the ptmgr easier to implement while allowing efficient
reuse
- provision for error handling is added, but will probably be revised in
a future commit pending discussion
- tor-ptmgr code that would generate warnings as a result of this change
is temporarily removed
This is a split out version of arti!886, intended so work on arti#659
can proceed.
|
| | |
|
| | |
|