| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
I find these names confusing. To my mind "check" implies a function
returning `Result<(), _>`.
Some other APIs use `unwrap` here but I think `if` is good.
|
| |\
| |
| |
| |
| | |
Bump edition of tor-dirserver and tor-dirauth
See merge request tpo/core/arti!4227
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
| |
This makes the `DirMirror` return a dummy 500 response.
This enables us to (manually) verify that the new relay BEGIN_DIR stream
handler works as expected. We will of course need some automated e2e
tests too, but for the time being a manual test should do.
This will all be replaced by the real implementation, once that's ready
(TODO DIRMIRROR).
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Removed unnecessary lint
Closes #2556
See merge request tpo/core/arti!4210
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Removed unnecessary lint
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
It doesn't make sense to say that a plain consensus is an "ns"
consensus, because "ns" stands for "network status" and all consensus
flavours, and indeed votes, are network statusus.
That's why tor-netdoc now uses "plain". Use that here too.
|
| | | |
|
| |/ |
|
| |
|
|
| |
Precisely the result of rustfmt.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
TimerangeBound is reasonably nice and this will fit in better when we
want to verify votes.
Adjust the one non-test call site (in tor-dirserver) using .and_then.
In the tests:
* Where we expected success, call .check_valid_at and add another .unwrap().
* Where we expected signature verification failure, delete the time parameters.
* Where we expected timeliness failure, call .check_valid_at and map the error.
* With nontrivial tolerance, add calls to `extend_[pre_]tolerance`.
|
| |
|
|
|
|
|
|
| |
This commit adds #[allow(clippy::string_slice)] to all functions in the
code where string slices are used, alongside a TODO comment.
We do this add the function header to have it consistent, as things like
expression based allow's are still experimental.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The NetdocParseableUnverified derive macro implements this
trait (amongst other things). Traits and derive macros should have
aligned names.
This is only used for parsing, so let's keep the "Parseable" part of
the name.
I don't think the effort of deprecated alias, for downstream
compatibility, is worth it, our compatibility policy notwithstanding.
|
| |\
| |
| |
| |
| | |
tor-netdoc: Sort out netstatus signatures
See merge request tpo/core/arti!3937
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use prod's Signature instead.
This gets rid of:
* The old parsing code. We have a new approach based on
ItemValueParseable, KeywordOrString and and DigestAlgoInSignature.
* The duplicate DirectorySignaturesHashesAccu and its temporary conversions.
poc's verify_timeless function needs a little adjustment for the new
struct layout.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If extra-infos is set to NULL, which might be the case for micro
descriptors or even router descriptors because the field is optional
there, this SQL query fails because it cannot LEFT JOIN
server.extra_unsigned_sha1 when this field is NULL.
To fix this, we simply add an additional clause to the WHERE statement
that filters such rows out.
|
| |/
|
|
|
|
|
|
| |
This commit changes the schema to make the fingerprint optional.
Reason for this is, that microdescriptors are also stored in this table
and microdescriptors only contain an OPTIONAL onion-key, meaning it may
not always be possible to determine this value from a microdescriptor,
thereby making it silly to require it here.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes use of the presence of only one descriptor hash inside
consensus_router_descriptor_member by adding a respective AND clause to
the select statements of missing descriptors to only select the rows
with a non-null SHA-1 (or SHA-2 for the sake of microdescs) in the
consensus_router_descriptor_member table.
This is defensive programming and should not be required in practice
because the docid as well as the "XOR" CHECK should already ensure that
this value is always non-NULL. However, if it still happens and slips
through, the statement would return NULL rows, which is not what we
want and was previously prevented by ensuring this field was never NULL
in the first place.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit modifies the consensus_router_descriptor_member table in the
database schema, removing the NOT NULL constraint on unsigned_sha1 and
unsigned_sha2 by replacing it with a new CHECK constraint that checks
that either one of them is set but not both.
The reason for this is as follows: We are going to use this table to
compute the queue of missing descriptors, which means that we can only
populate this table with the data we know from the consensus. The
consensus however tells us only one of those hashes, namely sha1 in the
case of a consensus-ns and sha2 in the case of a consensus-md.
In other words: This commit can also be seen as an effort to change the
design of the operation in such a way that the queue is obtained
directly from the database and not computed at the start during state
transition.
|
| |
|
|
|
| |
Rust 1.95 warns us that this is an experimental API that could be
stabilized in the future.
|
| |
|
|
|
|
|
|
|
|
|
| |
This method verifies all the signatures, and checks that the signing
authority is in the provided list. Anyway, authcerts aren't really
self-signed: they're a signature by KS_auth_id_rsa on
KP_auth_sign_rsa.
Note that there is also a `verify_selfcert` method which does only
some of the checks, and has some code duplication. That will be
cleaned up later.
|
| |\
| |
| |
| |
| |
| |
| | |
Force use of standard hasher with weak_tables.
Closes #2418
See merge request tpo/core/arti!3801
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #2418.
Fixes TROVE-2026-005, where we would use a less cryptographically
secure (and probably less DoS resistant) hash function for these
tables if:
- We are built alongside another crate that uses `weak-table`
- That crate enables the `weak-table/ahash` feature.
- We are running on a system without hardware AES.
Severity: Low
|
| |/
|
|
| |
Typos found with codespell
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We want to stop deriving NetdocParseable directly for body structs.
Doing so reveals a call site here in tor-dirmirror where a consensus
is parsed and the body data used, but without verifying the
signatures.
Do this explicitly with the hoop-jumping which is going to become
deliberately unavoidable. Add a TODO comment because I'm not sure we
have decided explicitloy that this is OK.
|
| |
|
|
| |
Formatting changes which make the next commit more readable.
|
| |
|
|
| |
This is going to contain body information, and the hashes, too.
|
| |
|
|
|
|
| |
This commit changes the functionality of the AuthCerts state to only
report a success when at least a single certificate was included in the
response.
|
| |
|
|
|
| |
Adds a small TODO with regard to a potentially broken retry logic in the
proof-of-concept.
|
| |
|
|
|
| |
This commit documents why and how we use the `unsigned_` fields in the
`consensus_router_descriptor_member` table alongside SQL limitations.
|
| |
|
|
|
| |
This commit moves dirserver POC code to an own module to semantically
indicate it is not production ready.
|
| |
|
|
|
|
| |
This commit documents why we drop the HTTP TCP stream and why this is
fine, namely because this is compliant HTTP/1.0 behavior where there is
no connection reuse.
|
| |
|
|
|
| |
This commit links the discussion for the TODO for the dirmirror's
handling of forward compatibility with netdocs.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This commit replaces the uses of sha1, sha2, and sha3 with their
respective pedants from tor-llcrypto for better consistency.
Internally, they still use the same logic and underlying crates but
let's use this encapsulation nonetheless.
|
| | |
|
| |
|
|
|
|
|
|
| |
This commit moves the database schema into schema_v1.sql and uses
include_str to include it. For now, the schema lives in the `src/`
directory. If this becomes a problem because we get more schemas and
schema upgrades, we can move it into another sub directory, but let's
not overengineer the hierarchy there.
|
| |
|
|
|
| |
This commit implements a PoC serving as the main loop for the FSM,
demonstrating how invocation and error handling works.
|
| |
|
|
| |
Discussed with nickm on IRC, there will be a torspec issue soon.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements the logic required for retrieving, validating,
and storing authority certificates.
The implementation determines the missing certificates by looking at the
signatories of the unvalidated consensus and checking them in the db.
Afterwards, they will be queried and individually filtered and verified
before being inserted into the database.
A return of this implementation notably DOES NOT imply all missing
certificates have been downloaded. This was chosen for a simplified
retry logic.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a new method to static engine that serves as a
convenience wrapper around `tor_dirclient::send_request`.
The reason for that is, that fetch_consensus is not the only method that
requires performing download requests, so it makes sense to generalize
it.
Besides, it also adds support for parsing multiple netdocs alongside
storing their raw variant, which is required for inserting them into the
database at one point eventually.
|
| |
|
|
|
| |
This commit adds the IsFatal trait to the err module for having a
generic signature for the fatality of certain error variants.
|