| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The string so far is exposed already via whole_for_signatures.
It is unusual for a doc parser to need this, but embedded documents
can use this plus byte_position to get the original input text for
their part of the outer document.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Roughly as per the proposal in `doc/dev/notes/authcert-in-consensus.md`.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We can use the real AuthCert now that it implements the parse2 traits.
The verification function is still used by poc's netstatus code and by
a test case.
We must change the field names in a few places, because the real
AuthCert's struct field names are the keywords, whereas the poc's are
the key names. (A shame that they're different!)
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Use accessors for the body.
(Eventually this function will replace, be replaced by, or merge with,
the existing signature code outside poc.)
|
| | | | | | |
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Implement authority certificate management
See merge request tpo/core/arti!3561
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Adding a comment suggesting to implement this as part of abstracting
`Sha256` behind a more generic identifier.
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit rpelaces the use of `INSERT` with `INSERT OR REPLACE` for
handling insertion conflicts in `store_insert`.
Because everything is content-addressed anyways, it does not matter to
do this, because if we get a conflict on a SHA256, it means the data is
equal.[1]
[1]: Excluding SHA-2 collisions which are impractical as of 2026.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit modifies the database::store_insert logic to accept an
iterator of the encodings to store the document in, instead of encoding
it with all encodings we support.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit changes `ErrorProblem::Other` to
`ErrorProblem::OtherBadDocument` while adding two new variants:
* `ErrorProblem::Internal`
* `ErrorProblem::BadApiUsage`
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Instead of failing, add them to missing and query them again.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit implements the logic necessary to retrieve the (missing)
directory authority certificates from an upstream directory authority.
In order to do so, this commit implements three new functions:
1. `download_authority_certificates()`
2. `parse_authority_certificates()`
3. `verify_authority_certificates()`
4. `insert_authority_certificates()`
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit adds an out-of-bounds memory check to
parse2::parse_netdoc_multiple_with_offsets while adding the guarantee
that interfacing applications do not need to validate the returned usize
values to be in-range.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit adds a CHECK constraint to the compressed_document table in
order to ensure that `algorithm` may only take up a limited set of
values.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit moves the ContentEncoding enum from the http module to the
database module, primarily because the content encoding is more of a
matter to the database, as this is where the data actually resides.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit implements support for adding arbitrary documents into the
store table.
It is non-trivial because the relevant data has to be compressed into
various formats, so it can be retrieved without delays.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit adds the `get_recent_authority_certificates()` function to
the operation of a directory mirror, which is responsible for looking up
the certificates in the database, returning the parsed found ones as
well as the missing ones.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The reverse direction already exists and it will be required when we act
with functions outside the crate that only accept a `SystemTime` in
situations where we just have a `Timestamp`.
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit adds the method `as_hex_upper(&self) -> String` to
`RsaIdentity`, which returns the `RsaIdentity` as a hexadecimal string
in uppercase.
Although this type already implements `ToString`, this result is
unsuitable for working with consensuses because they neither contain a
`$` prefix, nor are encoded in lowercase.
|
| | |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit marks the ConsensusFlavor struct exhaustive because handling
it in a non-exhaustive fashion would cause lots of redundant error
handling in tor-dirserver.
Besides, a change in the list of consensus flavors should indeed be
breaking for applications making use of this struct, as it is quite a
heavy change, from a netdoc point of view.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
tor-netdoc: Rename Version and expose it as netstatus::SoftwareVersion
See merge request tpo/core/arti!3594
|
| | |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This struct is still a bit odd, and there's a todo saying we may
change it again, but at least now it's now available.
While we're here, rename the variant Tor to CTor.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This function can only be called once within a program, so we can't call
it ourselves from a `TorClient`. The user must call it themselves, so we
should document this.
|
| | | | | | |
|
| |/ / / / |
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
tor-netdoc: Use manual non exhaustive in constructors
See merge request tpo/core/arti!3571
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3571#note_3325449
|
| | | | | |
| | | | |
| | | | |
| | | | | |
With `#[non_exhaustive]`, you're not allowed to write even `Thing { ..base }`.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This lets us having document items that are "manually non exhaustive"
which is necessary for struct literal constructors.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit speeds up the tests in `tor-dirserver` by using
functionality from Tokio's `test-util`.
Most notably, it runs the time intensive test in paused mode, which
means that the clock gets advanced either explicitly or implicitly using
auto-advance in case the runtime has nothing to do.
In our case, the last one, auto-advancing, is used, leading to our
sleep calls returning immediately.
This is good enough for testing in this module. It is not the
responsibility of tor-dirserver to ensure whether `RetryDelay` returns
proper values, as this is the responsibility of `tor-basic-utils`.
Still, it is a bit unfortunate that Tokio offers no way to manually
disbale the auto-advancing. In the future, it might be useful to
migrate more parts of this to crate to `tor-rtcompat`, but for now, this
change is a good enough performance fix.
|
| |/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit removes `mirror::download::test::request_fail_timeout` which
takes more than five seconds (due to a timeout) and is generally
ineffective in what it does, because testing whether a task is still
sleeping after a certain time is not super trivial with the tools Tokio
offers.
All this test offers is testing that we enter a timeout at all.
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
tor-dirserver: Eliminate use of sleep in tests
Closes #2308
See merge request tpo/core/arti!3582
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit eliminates the use of sleep in database tests because those
can be flaky, especially when the CI scheduler is overloaded, leading to
potential timeout invariants not holding true anymore.
We now fix this by using synchronization primitives from Rust in order
for threads to communicate. Documentation has been added explaining how
these tests work in greater detail.
Fixes #2308
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We aren't using this, and this crate still has a 0.x version. I think
this is OK, rather than having a deprecation period.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
SQLite does not support u64 and the new version of SQLite makes a
certain piece of tor-dirserver no longer compile due to the lack of
`ToSql` for `u64`. This commit fixes it by converting these types from
`u64` to `i64` saturatingly.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fix the conflict in tor-netdoc/semver.md by hand, including the new
entries already landed since v1.9.0.
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
chanmgr: Ability for the ChanMgr to be channel type specific and launch relay channels
See merge request tpo/core/arti!3563
|