| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Preparatory work for getting rid of some manual Debug impls
|
| |\ \
| | |
| | |
| | |
| | | |
arti-testing: Initial implementation
See merge request tpo/core/arti!378
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds a new program to try to implement the ideas behind
experimentation in arti#329. In particular, it tries to implement
basic client "can I bootstrap and connect" functionality testing,
with a lot of instrumentation, and support for breaking things.
So far, the instrumentation is limited to counting TCP bytes and
connections, and counting events. Still, this is enough to measure
behavior on some of the incorrect-clock tests.
NOTE:
For now, you are _required_ to pass in an explicit configuration, in
hopes that this will lead you to override your storage directories
for doing specific experiments.
|
| |/
|
|
|
| |
Apropos discussion in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/274
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Add tls_conn field to ArtiHttpConnector (and argument to constructor).
Introduce MaybeHttpsStream and use it in ArtiHttpConnection.
Have the example program pass the native TLS connector.
Currently the TLS connector and the HTTPS variant are not used, but
this commit is very noisy and fomrulaic, so I have split out the code
to use them into a separate commit for easier preparation and review.
|
| |
|
|
|
|
| |
(It's good to do this a couple of days in advance in case it turns
up any bugs. That's how we caught the panic bug in simple_asn1
0.6.0)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
We need this not to use anyhow because we don't want our libraries to
expose anyhow, and this is about to go into the library.
|
| |
|
|
| |
Code motion and consequential dependency adjustments.
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| | |
This isn't complete (see TODO), but it's enough to let us report the
right ErrorKind if something fails to parse.
|
| | | |
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
arti-client: add ability to automatically bootstrap
Closes #278
See merge request tpo/core/arti!322
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The new `BootstrapBehavior` enum controls whether an unbootstrapped
`TorClient` will bootstrap itself automatically (`Ondemand`) when an
attempt is made to use it, or whether the user must perform
bootstrapping themselves (`Manual`).
The `lazy-init` example shows how you could write a simple
`get_tor_client()` function that used a global `OnceCell` to share
a Tor client across an entire application with this API.
closes arti#278
|
| |\ \
| |/
|/|
| |
| | |
tor-cell and tor-proto: provide HasKind.
See merge request tpo/core/arti!304
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Additionally, refactor the IoError out of tor_cell::Error:
nothing in TorCell created this; it was only used by tor_proto.
This required refactoring in tor_proto to use a new error type. Here I
decided to use a new CodecError for now, though we may refactor that
away soon too.
|
| |\ \
| |/
|/|
| |
| | |
Refactor errors in tor-netdoc
See merge request tpo/core/arti!314
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This error type doesn't impement HasKind, since the kind will depend
on context.
However, the existing implementation was pretty messy and inconsistent:
Some errors had positions, some didn't.
Some took messages as str, some as String.
Some had internal errors that were somewhat orthogonal to their actual
types.
This commit refactors tor_netdoc::Error to use a ParseErrorKind, and
adds a set of convenience functions to add positions and
messages to the errors that need them.
|
| |/
|
|
|
|
|
|
| |
Since the only purpose of this function is to make sure that no
bootstrapping task is running, a simple futures::lock::Mutex
should do the job just fine.
Closes #337.
|
| |\
| |
| |
| |
| |
| |
| | |
Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)
Closes #293
See merge request tpo/core/arti!298
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit changes how the `TorClient` type works, enabling it to be
constructed synchronously without initiating the bootstrapping process.
Daemon tasks are still started on construction (although some of them
won't do anything if the client isn't bootstrapped).
The old bootstrap() methods are now reimplemented in terms of the new
create_unbootstrapped() and bootstrap_existing() methods.
This required refactoring how the `DirMgr` works to enable the same sort
of thing there.
closes #293
|
| | |
| |
| |
| |
| | |
(This error isn't yet wrapped in TorError, but it will be eventually
when we implement socks proxy and PT support.)
|
| | |
| |
| |
| |
| |
| | |
This crate's Error type is too low-level to have an ErrorKind, but
it does make sense to use InternalError for the internal errors
here.
|
| |/
|
|
| |
This required a few new ErrorKinds.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This needs two kinds. We have decided to treat a non-shutdown
SpawnError as "unexplained" rather than as an InternalError.
There are many crates whose
From<futures::task::SpawnError> for Error
erroneously treat it as an internal error. We will fix them in a moment.
|
| |
|
|
| |
Doing this here makes it easier when I rebase/reorder things
|
| |
|
|
| |
This can contain a backtrace, which will be printed.
|
| |
|
|
|
|
| |
As per doc/Errors.md.
Currently there are no error kinds. Some will be added as we go along.
|
| |
|
|
| |
Closes #270
|
| |
|
|
|
|
|
|
| |
tor-netdir needs to bump because tor-netdoc bumped, even though
there were no other changes in tor-netdir. Whoops.
tor-guardmgr needs to bump because it already published, with the
older tor-netdir.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This change uses the async-native-tls crate for everything, and
deletes some duplicated code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is based on @janimo's approach in !74, but diverges in a few
important ways.
1. It assumes that something like !251 will merge, so that we can
have separate implementations for native_tls and rustls compiled
at the same time.
2. It assumes that we can implement this for the futures::io traits
only with no real penalty.
3. It uses the `x509-signature` crate to work around the pickiness of
the `webpki` crate. If webpki eventually solves their
[bug 219](https://github.com/briansmith/webpki/issues/219), we
can remove a lot of that workaround.
Closes #86.
|
| |
|
|
|
| |
This will make it easier to implement them using some other TLS
provider as well, without having to duplicate all of our code.
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The information is pretty basic here: we use "have we been able to
connect/TLS-handshake/Tor-handshake" as a proxy for "are we on the
internet? Are we on a reasonably unfiltered part of the internet?"
Eventually we'll want to make the information gathered and exported
more detailed: I've noted a few places in the code. For now,
however, this is about as good as C Tor does today, and it should be
a good starting point.
This uses a slightly different design from tor-dirmgr. Instead of
exporting an entire state structure via `postage::watch`, it exports
only the parts of that structure which the user is supposed to
read. I think that's more reasonable in this case because most of
the possible internal transitions in the tor-chanmgr state don't
cause a change in the exposed status.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The interface is similar to the one exposed by `arti-client`: it
internally uses postage::watch to give a series of events showing
when a bootstrap status is changing.
Thanks to the existing state/driver separation in the DirMgr design
we don't need much new logic: each download state needs to expose
(internally) how far along it is in its download, which the
bootstrap code passes to the DirMgr if it has changed.
I believe that in the long run, we'll probably want to expose more
(or different) information here, and we'll want to process it
differently. With that in mind, I've made the API for
`DirBootstrapStatus` deliberately narrow, so that we can change its
of its internal later on without breaking code that depends on it.
(The information exposed by this commit is not yet summarized in
`arti-client`.)
Part of #96.
|