| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Remove the channel type from Unverified and Verified channels and
instead use the channel type in the underlying channel codec.
The codec requires such type in order to restrict messages sets. Instead
of duplicating it, this commit simply makes it that there is now only a
single channel type attached to a channel structure.
The resulting `struct Channel` in the end gets it copied from the
channel codec as the framed_tls gets split and given to the `Reactor`.
Down the line, we need a channel type attached to the `Channel` in order
to know if it is a client or not and authenticated or not.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Avoid having one None and the other Some which would be a bug.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Instead, use the static AUTHTYPE_ED25519_SHA256_RFC5705 value which is
for now the only version we support.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
A Responder receiving cells from the Initiator, if it gets a CERTS, an
AUTHENTICATE must also be present (and vice-versa).
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is so check() only authenticate a channel. The finish() function
now only sends back the missing cells and build the final Channel.
To pull this off, the AUTHENTICATE cell and our IP addresses need to be
copied into the VerifiedRelayChannel.
This allows us to remove complexity into the check() function as well
and future commit will remove the async.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
We can't get into the UnverifiedChannel::check() without wanting to
verify our identities and authenticate.
This validation has moved before calling check() for the relay channel
type.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Reason for this is so we can use the type system to enforce that a
client/bridge<-> relay channel can never become verified and thus in the
code path of authentication.
In other words, when check() is called, without an authentication cell,
we can't authenticate or even verify the identities so we immediately
return "self" which in this case is the UnverifiedRelayChannel.
That channel can be finish()-ed to yield a Channel that can never be
considered authenticated.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Once channel is verified and authenticate if need be, send the NETINFO.
We require our advertised IP addresses for this so pass them to launch()
as well to the UnverifiedRelayChannel.
A cargo fmt change slipped in here, sorry about that.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit is a bit loaded but it is coherent.
First, we set Eq and PartialEq to the channel message Authenticate so we
can compare it with the one we expected.
Second, the AuthenticationCell enum is introduced to store either an
AUTH_CHALLENGE or an AUTHENTICATE since one side of the handshake can
only have one. This allows us to store one or the other in
UnverifiedRelayChannel.
Depending on what we have, the authentication process is different as it
dictates which side we are on (initiator vs responder). Keep in mind
that the handshake code enforces receiving a AUTH_CHALLENGE along side
CERTS. And same goes for AUTHENTICATE which means that if we have an
AUTH_CHALLENGE in the UnverifiedRelayChannel, it is certain that the
other side wants to authenticate and we are the initiator.
Finally, the sending of CERTS and AUTHENTICATE by the initiator is now
in UnverifiedRelayChannel::check() done right after verifying the
channel CERTS and holding a "VerifiedChannel" object.
This means that the last piece, sending the `NETINFO` by the initiator
will be done in the check() but in a future commit. This leaves the
VerifiableChannel::finish() to send nothing and only finalize the
channel with the NETINFO (canonicity).
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Relay initiator needs to send CERTS and AUTHENTICATE in that function
after verifiying the channel.
And thus require to be async.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
We need this trait for the underlying TLS stream in order to access data
such as the certificates or keying material.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Reason for this is because both initiator and responder build the
authentication data in order to send it (initiator) and validate it
(responder).
The build_auth_data() function takes a VerifiedChannel as an argument in
order to access the CLOG/SLOG data and authentication data MUST always
be handled after a channel is verified as in its CERTS has been checked.
Take the opportunity also to add the NETINFO and relay identities data
into the verified channel which will be needed to finalize the channel.
The check() function is now missing the actual validation of the
AUTHENTICATE for a responder which will come in the next commit(s).
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit introduces the RelayResponderHandshake object used when
accepting an inbound connection to open a channel.
There are still TODOs pepperred in the code but the base is implemented.
The Unverified and Verified channel need to be adjusted for this new
handshake.
This will come in the next commits.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Again, as the CERTS helper, this is used by both initiator and responder
handshake.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Both initiator and responder send CERTS cell hence this helper.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
We need the advertised addresses for the NETINFO cell when opening a
relay channel. Keep them in the TorRelay object so we can pass them to
the ChanMgr channel handler.
This will also help with config reload where only the local values in
TorRelay will need to be updated.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
It is always the same type for this specific certificate.
Signed-off-by: David Goulet <[email protected]>
|
| | | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This requires to make a series of cert and digest also optionnable in
the VerifiedChannel.
This change is needed because as a relay responder, you might get the
CERTS or not depending on if the other side wants to authenticate.
Client and bridges do not authenticate and thus it is expected to not
have a CERTS cell.
This leads to the UnverifiedChannel::check() function to return early
with a VerifiedChannel without any identity attached to it.
Signed-off-by: David Goulet <[email protected]>
|
| | | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Code movement only.
Signed-off-by: David Goulet <[email protected]>
|
| |\ \ \ \ \ \
| |_|_|/ / /
|/| | | | |
| | | | | |
| | | | | | |
arti-relay: Change debug message to rate-limited warning
See merge request tpo/core/arti!3602
|
| | | |/ / /
| |/| | | |
|
| |\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | |
| | | | | |
tor-dirserver: Refactorings in the database.rs module
See merge request tpo/core/arti!3599
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit removes FromStr for DocumentId because it was only used in
testing anyways.
Instead, it replaces it with a simple From<[u8; 32]> only enabled in
test builds, which is sufficient for what we are trying to do.
An alternative would be to make the inner field pub, but this seems to
aggressive for a testing only thing.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This comit adds a `sha2` column to `router_descriptor` alongside a
`CHECK` to see whether it equals `docid`.
The reason for this is simple: Microdescriptors are the only kind of
documents that are queriable with a SHA2 hash. Previously, we would
have simply used the `docid` column for this, but in order to abstract
it better, a distinct column with this hash is better.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Because we went with `docid` in the database (due to `rowid`), it is
only natural to call the code variables `docid` too.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit renames the sha256 column to docid for the reason that we
agreed upon making the schema visible to all modules, so if we were to
encapsulate docid properly, this change is only natural.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit renames arti_dirmirror_schema_version to
arti_dirserver_schema_version.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit introduces a new type in the database module named
`DocumentId` for abstracting the underlying content-addressable hash
algorithm we are using.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
tor-dircommon: Remove legacy authority syntax
See merge request tpo/core/arti!3597
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Because arti 2.0 is pending, it is good to get rid of technical debt,
such as the legacy syntax for specifying directory authorities, which
had been replaced by prop330 a few months ago.
|
| |/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
This commit adds more documentation/examples for the prop330 syntax for
specifying directory authorities.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
tor-dirserver: Make downloader stateless
See merge request tpo/core/arti!3601
|
| | | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit makes the downloader found in `mirror::operation::download`
stateless by removing the `preferred_authority` field and changing all
methods from `&mut self` to `&self`.
The preferred authority is now accepted as a parameter to
`DownloadManager::download` which also returns a tuple now with the
actually used authority alongside the response, putting the management
of this to the responsibility of the caller.
Meanwhile, it also renames the structure from `ConsensusBoundDownloader`
to `DownloadManager` because it no longer keeps a state that
invalidates after a consensus "ends".
The purpose of this is to simplify overall state in order to make the
implementation of a finite-state-machine for the dirmirror operation
more easy (and deterministic).
|
| |\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
Bump chutney
See merge request tpo/core/arti!3604
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously this was naively wrapping strings in double-quotes. This
works ok for escaping internal whitespace, but doesn't escape other
special characters.
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Bump chutney, and migrate to CLI changes introduced in chutney!101
|
| |/ / / / |
|
| |\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | | |
Use kebab case for all scripts in maint/
See merge request tpo/core/arti!3590
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Change the script name to use hyphens, not underscores.
Make the script name and the CI job name the same, except the script
has -arti at the end in case we add more similar checks.
|
| | | | |
| | | |
| | | |
| | | | |
This avoids tripping over things like `__pycache__`
|
| | | | | |
|
| | | | | |
|