Commit Graph

317 Commits

Author SHA1 Message Date
Nick Mathewson eee5d847be rpc-meta-draft: consistently say "request" or "method", not "command". 2023-03-24 17:28:19 +00:00
Nick Mathewson 5f9a28d227 rpc-meta-draft: make a number of localized changes from the review. 2023-03-24 17:28:19 +00:00
Nick Mathewson 906b4bb631 Start drafting a dev note about a JSON-based OO RPC design. 2023-03-24 17:28:19 +00:00
Nick Mathewson 18e8ac7cb6 Rename key identifiers that have changed in the spec
Generated with perl:

s/K([PS])_hs_intro_tid/K$1_hs_ipt_sid/g;
s/K([PS])_onion_ntor/K$1_ntor/g;
s/K([PS])_hs_intro_ntor/K$1_hss_ntor/g;
s/K([PS])_hs_desc_ephem/K$1_hss_desc_enc/g;
2023-02-08 11:57:51 -05:00
Nick Mathewson d790ba2776 ffi_rpc_sketch: rearrange. 2023-02-03 08:55:21 -05:00
Nick Mathewson 19346ee891 ffi_rpc_sketch: tweak colors. 2023-02-03 08:54:02 -05:00
Nick Mathewson 49b217486a Add a sketch for our FFI/RPC architecture
I think that this might be the way forward, depending on our current
requirements and our users' current needs.  I've traced out some
challenges that would imply.
2023-02-03 08:48:33 -05:00
Alexander Færøy d41dbc2a46 Update Tor number for s101 o3 (Tor: 2033cc7b5e). 2023-01-27 12:50:06 +01:00
Alexander Færøy e30ece3532 Fix typo. 2023-01-27 12:46:14 +01:00
Nick Mathewson 79c6881366 exportedapisketc: note that HTTP can be tricky. 2023-01-26 08:29:46 -05:00
eta 51741398b2 Merge branch 'netdoc-builder' into 'main'
tor-netdoc: Provide NetdocEncoder (internal)

See merge request tpo/core/arti!984
2023-01-26 11:40:50 +00:00
Nick Mathewson 422e3382aa New results for heap_and_download_size.md 2023-01-25 14:59:46 -05:00
Nick Mathewson 410d05697f Try to be less ambigous about "maybe offline"...
...by defining "offline" as "maybe online".

@diziet is this what you had in mind?
2023-01-24 11:39:10 -05:00
Nick Mathewson b667faf5c5 Try to specify which keys are which
Use the terminology in the current draft torspec!105 MR.
2023-01-24 11:39:10 -05:00
Nick Mathewson 8764c64564 Add a note about key storage in onion services and clients 2023-01-24 11:39:10 -05:00
Ian Jackson 16c4fee4b8 netdoc-builder: Move example into implementation doc comment
Not actually tested yet
2023-01-24 16:15:17 +00:00
Ian Jackson e971d1ad59 netdoc-builder api: Move internal API into actual code file
Motion, plus the bare minimum needed to make it compile.
2023-01-24 16:15:17 +00:00
Ian Jackson bb5565b800 netdoc-builder api: Remove obsolete proposed `Item` changes
We decided against these in !969
2023-01-24 16:15:17 +00:00
Ian Jackson 99686c61de netdoc-builder api: Write down the correctness (non)-guarantees 2023-01-20 14:21:17 +00:00
Ian Jackson 6f17a88b0b netdoc-builder api: Make object() take self
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/969#note_2869594
2023-01-20 14:21:17 +00:00
Ian Jackson 694de0e163 netdoc-builder api: Change object multiplicity to 0 or 1 2023-01-20 14:21:17 +00:00
Ian Jackson 673d13a82b netdoc-builder api: Provide raw methods 2023-01-20 14:21:17 +00:00
Ian Jackson 2fdb65287d netdoc-builder api: Fix typo 2023-01-20 14:21:17 +00:00
Ian Jackson 3ce394f168 netdoc-builder api: Clarify ItemEncoder.objects content 2023-01-20 14:21:17 +00:00
Ian Jackson fa96addf01 netdoc-builder api: In internal notes don't promise not to eagerly add 2023-01-20 14:21:17 +00:00
Ian Jackson 0755069e5a netdoc-builder api: Rename internal Builder to Encoder
This seems clearer now and also it solves the name clash with the
`NetdocBuilder` trait.
2023-01-20 14:21:17 +00:00
Ian Jackson 8f2263237b netdoc-builder api: Get rid of Item, and error rework 2023-01-20 14:21:17 +00:00
Ian Jackson 46ad6cba06 netdoc-builder api: Add example of use 2023-01-20 14:21:17 +00:00
Ian Jackson 28b99004d0 NetdocBuilder: Improvements apropos review 2023-01-20 14:21:17 +00:00
Nick Mathewson 760ddbbc5d Improved pseudocode commentary 2023-01-20 14:21:17 +00:00
Ian Jackson 7184777559 RFC netdoc builder API 2023-01-20 14:21:17 +00:00
Nick Mathewson 0ad44d2d6f Update comments based on feedback 2023-01-17 12:21:17 -05:00
Ian Jackson b6f5d3da7d Apply 1 suggestion(s) to 1 file(s) 2023-01-13 16:44:03 +00:00
Ian Jackson bf970ba486 Apply 1 suggestion(s) to 1 file(s) 2023-01-13 16:43:48 +00:00
Nick Mathewson ecff8731cc Sketch for some options and design issues around FFI/RPC
This is just a beginning, but hopefully we can expand it with more
information and options, and then use it to get everybody in our
nascent FFI/RPC working group on the same page.
2023-01-13 09:47:37 -05:00
Nick Mathewson 2ad198784d Merge branch 'hilev_docs' into 'main'
Architecture: More high-level documentation and diagrams.

Closes #624

See merge request tpo/core/arti!963
2023-01-06 19:17:29 +00:00
Nick Mathewson a0ddf51f77 Architecture.md: Move title outside of diagram
Apparently, Mermaid 9.1 did not support this.
2023-01-06 13:37:27 -05:00
Nick Mathewson fe9bf17937 Add a protocol overview for onion services. 2023-01-06 13:03:50 -05:00
Nick Mathewson 5358339169 Architecture: More high-level documentation and diagrams.
Specifically, I'm adding a high-level MDD (simplified for clarity).

I'm also adding a diagram of the object relations among our manager
types.  (There are also communications that happen via channels, but
those aren't discussed here.)  That part closes #624.

There is probably more to say here, but this should form a scaffold
we can build on.
2023-01-05 17:11:38 -05:00
Emil Engler 4fc70ccacf
doc: update the crate list in Architecture.md
This commit updates the crate list in Architecture.md. Because of the
previous commit, which introduced consistency to these files, it was
possible to generate it fairly easy with a tiny Perl script.
2022-12-20 14:33:59 +01:00
Nick Mathewson 77c23b8474 Add another step to the release process 2022-12-10 16:16:42 -05:00
Nick Mathewson 2c240923fc Move developer-facing documentation into a doc/dev subdir
Closes #576.
2022-12-05 08:58:39 -05:00
Nick Mathewson 9d01c88c8c Update bridges.md a little 2022-11-30 16:21:50 -05:00
Nick Mathewson a2f148dc4e Add a quick "how to use bridges" explanation document. 2022-11-30 16:04:36 -05:00
trinity-1686a 614cf34284 Check more targets 2022-11-10 13:34:17 +00:00
Alexander Færøy d092c7fa90 Add September values to heap_and_download_size.md. 2022-10-25 21:52:16 +02:00
Alexander Færøy 2cc1996bb6 Add Methodologies section to our Heap and Download Size document. 2022-10-25 21:51:56 +02:00
Alexander Færøy 7a99555e9d Add missing data from October from Nick. 2022-10-25 21:51:37 +02:00
Alexander Færøy a8a2de747b Update heap and download size metrics for October
This patch updates the heap_and_download_size.md file with numbers from
October 2022 for our Sponsor 101 deliverables.
2022-10-25 19:56:35 +02:00
Nick Mathewson 5786637b4f Fix various typos (using typos tool and hand-inspection) 2022-10-18 15:39:33 -04:00
Ian Jackson 881f6edd9f Abolish maint/readmes
This is not needed any more
2022-10-12 15:29:04 +01:00
Nick Mathewson 239c1f044f Add a reminder to remove semver.md after release. 2022-09-07 09:20:30 -04:00
Nick Mathewson 35c2a5dc62 Merge branch 'bridge_writeup' into 'main'
Overview of issues with bridges in 1.1.0

See merge request tpo/core/arti!686
2022-08-26 18:20:49 +00:00
Nick Mathewson 8f7149931e Qualify a few statements about bridges. 2022-08-26 13:42:38 -04:00
Nick Mathewson 7700ee3892 Remove first person: Now my opinions are facts. ;) 2022-08-26 13:38:52 -04:00
Nick Mathewson 063c8fc545 Note tickets for TODO items.
Also remove controversial paragraph that is now maybe a bug.
2022-08-25 09:36:08 -04:00
eta 31e3649b3e Apply 1 suggestion(s) to 1 file(s) 2022-08-25 13:12:33 +00:00
Nick Mathewson 44e56d35aa First draft of "what is sensitive" document 2022-08-23 15:31:26 -04:00
Nick Mathewson 96d21cf4da Overview of issues with bridges in 1.1.0 2022-08-23 10:36:03 -04:00
Ian Jackson 12c5af9b7a doc/Compatibility.md: tick the box for link protocol 5
We do this now.  As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828364
2022-08-17 10:54:41 +01:00
Nick Mathewson e3cc533853 Merge branch 'zeroize' into 'main'
Revise our handling of the zeroize trait

Closes #254

See merge request tpo/core/arti!655
2022-08-04 14:54:21 +00:00
Nick Mathewson 96d1b500a7 ZeroizeStrategy.md: Clarify which list we're referring to. 2022-08-04 10:26:15 -04:00
Dimitris Apostolou 5eb45de6f8
Fix typos 2022-08-01 23:55:33 +03:00
Nick Mathewson c83ec273d0 Initial document describing our plans for zeroize 2022-08-01 11:52:23 -04:00
Nick Mathewson 054616c281 Checkpoint metrics and discussions on Sponsor 101 metrics
These metrics are primarily concerned about heap usage and download
size.  I've worked on them for our latest report, and I want to
check them in someplace so we don't forget them the next time we
want to run these.
2022-07-22 10:21:41 -04:00
Nick Mathewson c9552220dc Update semver_status.md with new procedure.
Now (per discussion on #471) we use one file per crate.

I've tried to be more explicit about the format to use, and what to
add when.
2022-05-27 11:55:29 -04:00
Nick Mathewson 4f7e06fe17 Clear out 0.4.0 semver-status 2022-05-27 11:36:33 -04:00
Ian Jackson 4bf87d61ca Merge branch 'config-split' into 'main'
Break TorClientConfig out of ArtiConfig and warn on unknown config keys

Closes #459 and #417

See merge request tpo/core/arti!529
2022-05-26 10:40:43 +00:00
Nick Mathewson bc3c9d475f Merge branch 'support_policy' into 'main'
Initial draft policy on supported platforms and dependencies

Closes #379

See merge request tpo/core/arti!513
2022-05-25 13:14:54 +00:00
Ian Jackson 112cce10ba semvar_status: Document config changes 2022-05-24 20:17:23 +01:00
Ian Jackson 814faf6398 Apply clarifications to SupportPolicy.md from @Diziet 2022-05-24 15:13:54 +00:00
Nick Mathewson de3c7baa4c Note that fs-mistrust has broken semver. 2022-05-24 10:54:02 -04:00
Nick Mathewson 6a00b74b0b Clarify which releases get advisories. 2022-05-20 11:57:03 -04:00
Nick Mathewson a42a6467a1 SupportPolicy: Add tiers, clarify what "support" means. 2022-05-20 11:52:22 -04:00
Nick Mathewson 8406cc3b7f Initial draft policy on supported platforms and dependencies 2022-05-18 09:24:46 -04:00
Nick Mathewson fb432924a3 Merge branch 'main' into 'ticket_466'
# Conflicts:
#   doc/semver_status.md
2022-05-16 15:10:00 +00:00
Ian Jackson 4b86818b30 Document semver changes 2022-05-13 12:47:38 +01:00
Nick Mathewson f0eac61838 Merge branch 'network-config-error' into 'main'
Delete tor_dirmgr::Error::BadNetworkConfig

See merge request tpo/core/arti!506
2022-05-12 16:43:26 +00:00
Nick Mathewson 1698a2fea1 Merge branch 'template' into 'main'
Make the example config file into a template and move it to arti

See merge request tpo/core/arti!503
2022-05-12 16:34:00 +00:00
Ian Jackson d847d49858 Delete tor_dirmgr::Error::BadNetworkConfig
This was anomalous, in that it contains &'static str, rather than a
proper nested error (eg a config::ConfigError, maybe).

But in fact it tursn out it is now not constructed.  The last
construction site was removed a long time ago in
  Use derive_builder for Authority and FallbackDir.
2022-05-12 16:49:06 +01:00
Nick Mathewson 2a5ee2c8c9 Merge branch 'ticket_412_467' into 'main'
Teach DirMgr to use slightly untimely directories

Closes #467 and #412

See merge request tpo/core/arti!500
2022-05-12 14:42:51 +00:00
Ian Jackson d407ce519b Add semver note for these changes 2022-05-12 15:24:32 +01:00
Nick Mathewson 0c939d45fc dirclient: add the ability to reject circuits that are too skewed.
This will help implement #466.
2022-05-11 13:48:55 -04:00
Nick Mathewson 0c05baa68b Add a channel accessor to ClientCirc.
I need this so that I can expose the skew time for the directory
that a circuit will use, when I only have the circuit.
2022-05-11 13:02:36 -04:00
Nick Mathewson 12d1752ad5 tor-netdoc: Add a Lifetime::valid_at method. 2022-05-11 12:11:17 -04:00
Ian Jackson 775432bee8 Document semver changes to ConfigurationSources etc. 2022-05-11 15:53:17 +01:00
eta 864fd03917 Improve documentation around Cargo features; make Runtime require Debug
- arti#445 highlighted the lack of good documentation around Arti's
  multiple runtime support, as well as it being difficult to determine
  what runtime was actually in use.
- Improve the documentation to solve the first problem.
- To solve the second problem, make Runtime require Debug (which is
  arguably a good idea anyway, since it makes them easier to embed in
  things), and print out the current runtime's Debug information when
  arti is invoked with `--version`.
- (It also prints out other Cargo features, too!)

fixes arti#445
2022-05-11 13:26:35 +01:00
Nick Mathewson 3b0336e841 netdoc: add a new type for Nicknames
Relay nicknames are always between 1 and 19 characters long, and
they're always ASCII: That means that storing them in a [u8;19] will
always be possible, and always use less resources than storing them
in a String.

Fortunately, the tinystr crate already helps us with this kind of
thing.
2022-05-09 15:59:38 -04:00
Nick Mathewson 4262e9d0ec Merge branch 'use-fs-mistrust' 2022-05-09 15:27:25 -04:00
Nick Mathewson 8a62f9ce52 Remove "Mistrust" from the public API of arti-client.
I'm doing this per discussion, so that we can have it be part of the
TorConfig later on, and not break stuff as we change the Mistrust
API to have a builder.

This change, unfortunately, results in a little more internal
complexity and duplicated code in arti and arti-client.  I've marked
those points with TODOs.
2022-05-09 14:40:29 -04:00
Nick Mathewson b0f39abe32 arti: use fs-mistrust to validate configuration file locations. 2022-05-09 14:40:29 -04:00
Nick Mathewson 2938268f34 arti-client: Configure and use fs-mistrust.
This is derived from the environment, not the configuration file: We
might not want to trust the configuration file until we've decided
whether we like its permissions.
2022-05-09 14:40:29 -04:00
Nick Mathewson 20a85061b6 Update tor-dirmgr to use fs-mistrust. 2022-05-09 14:40:29 -04:00
Nick Mathewson 984190b3a3 tor-persist: Use fs-mistrust to verify state file permissions. 2022-05-09 14:40:29 -04:00
Nick Mathewson 16eeb16b4c Clear semver_status now that 0.3.0 is coming out. 2022-05-06 10:08:08 -04:00
Ian Jackson acf38505ee semver notes: Fix a missing paren 2022-05-05 10:35:52 +01:00
Ian Jackson 31ce7f4bc0 semver note about serde attribute changes 2022-05-05 10:35:52 +01:00
Ian Jackson a334f17262 Merge branch 'socket-addr-list-builder' into 'main'
FallbackDir: orports: Introduce and use VecBuilder

See merge request tpo/core/arti!474
2022-05-04 18:13:45 +00:00
Ian Jackson 4ad4cae418 FallbackDir: Use VecBuilder for orports
And drop the ad-hoc orport() method.  This brings FallbackDir's
orports field in line with our list builder API.

The general semver note in "configuation" seems to cover most of this.
2022-05-04 17:18:55 +01:00
Ian Jackson 4262a440b5 list_builder: Update semver note 2022-05-04 17:18:55 +01:00
Ian Jackson c84d60910d GuardUsage: restrictions Add semver note 2022-05-04 16:19:09 +01:00
Samanta Navarro 1d62d92fb9 Fix spacing 2022-04-27 13:52:43 +01:00
Samanta Navarro c53818d496 Fix grammar and typos 2022-04-27 13:52:13 +01:00
eta 8509dbc920 Merge branch 'upgrade_dependencies' into 'main'
Upgrade various dependencies, now that we are MSRV 1.56

Closes #313 and #334

See merge request tpo/core/arti!476
2022-04-27 12:27:28 +00:00
Nick Mathewson 5484bcc21f Merge branch 'download-schedule' into 'main'
DownloadSchedule: Introduce Builder

See merge request tpo/core/arti!473
2022-04-26 18:47:08 +00:00
Nick Mathewson aaab6f3812 Upgrade to AES 0.8
Now that we require Rust 1.56, we can upgrade to AES 0.8.  This
forces us to have some slight API changes.

We require cipher 0.4.1, not cipher 0.4.0, since 0.4.0 has
compatibility issues with Rust 1.56.
2022-04-26 12:16:22 -04:00
Ian Jackson 20d61dd4d4 DirMgrConfig: Rename two fields that contained a _config
This entire struct is config.  This is otiose.
2022-04-26 15:29:33 +01:00
Ian Jackson d2cc0aa50a Document breaking changes to DownloadSchedule etc. 2022-04-26 15:19:52 +01:00
Nick Mathewson c1ea419477 Merge branch 'main' into 'msrv_1_56'
# Conflicts:
#   crates/tor-config/Cargo.toml
#   crates/tor-dirmgr/src/state.rs
#   doc/semver_status.md
2022-04-26 12:45:16 +00:00
Nick Mathewson d1fcd3eeae Update semver_status to note that all crates have had a breaking change. 2022-04-25 13:31:06 -04:00
Ian Jackson 3f44078227 Add semver note about added macros in tor-condfig 2022-04-25 18:19:03 +01:00
Ian Jackson f6506721ab Add semver notes for AuthorityListBuilder, PredictedPortsListBuilder
These were omitted in the earlier commits.
2022-04-25 18:15:25 +01:00
Ian Jackson 166af2c3f6 Fix error return type of AuthorityBuilder 2022-04-25 12:41:39 +01:00
Ian Jackson 79decd4ac8 logfiles: Introduce LogfileListConfigBuilder
In
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
we decided not to do this.

However, having looked again at the way the FallbackList works, I
think there is a lot of value in making these two things (and anything
else like them[1]) as similar as possible.

[1] At least PreemptiveCircuitConfig.initial_predicted_ports and
NetworkConfig.authorities need the same treatment, and perhaps also
GuardUsage.restrictions (although there is no
GuardRestrictionBuilder).

In the irc discussion I imagined `LogfilesConfigBuilder` as opposed to
`LogfileConfigBuilder` (differing only in the `s`) which would be bad,
but we can use `List` instead.

We do *not* need to abstract away the validated version of the config.
Providing a type alias helps the derive_builder sub_builder DTRT
without needing special overrides.

I have split this commit so that we can drop it, if we conclude it's
not wanted.
2022-04-22 17:48:03 +01:00
Ian Jackson 962b6c32e1 fallback list: Introduce and use FallbackListBuilder
Now the network fallbacks configuration wants to Deserialize
a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>.

Methods on FallbackListBuilder are as per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
mutatis mutandi for the fact that this struct has only fallbacks in it.
2022-04-22 17:48:03 +01:00
Samanta Navarro d3031b437b Fix wording in FAQ 2022-04-20 11:48:45 +00:00
Samanta Navarro 142e57b03a Fix typos
Typos found with codespell.
2022-04-20 11:48:43 +00:00
Nick Mathewson 482c022e23 circmgr: Remove now-unused scheduled entry points.
Now that we have TaskSchedule, we don't need to expose these any
longer.
2022-04-12 09:04:10 -04:00
Nick Mathewson cf362fac9f Implement a better clock skew estimator.
This time, our estimator discards outliers, takes the mean of what's
left, and uses the standard deviation to try to figure out how
seriously to take our report of skew/not-skew.

These estimates are still not actually used.
2022-04-11 12:34:16 -04:00
Nick Mathewson 0050045867 ChanMgr: Return provenance information from get_or_launch
We need this since we want to report certain conditions only when
they happen on a new channel, not if we observe them on a
preexisting channel.
2022-04-07 10:46:06 -04:00
Nick Mathewson 9160b55c57 chanmgr: bubble ClockSkew up through the Error object.
Fortunately, we don't need a separate type here: authenticated
clock skew can only come attached to a `tor_proto::Error`.

We also remove skew from `tor_proto::Error::HandshakeCertsExpired`,
since it would now be redundant.
2022-04-07 10:15:28 -04:00
Nick Mathewson 7656ab0931 Channel: Expose our view of whether the clock is skewed, and the age
of a channel.

At first I wanted to have this information not be a part of channels
at all, but it is a fairly tiny amount of data, and the alternatives
are pretty crufty.
2022-04-07 10:07:35 -04:00
Nick Mathewson 142e28cd96 Merge branch 'main' into 'separate_dir_status'
# Conflicts:
#   doc/semver_status.md
2022-04-06 13:33:01 +00:00
Nick Mathewson 2c51316604 Merge branch 'main' into 'retriable'
# Conflicts:
#   doc/semver_status.md
2022-04-05 14:48:51 +00:00
Nick Mathewson 57608f9609 Add RetrySchedule::reset()
Previously the code would do stuff like

```
    schedule = RetrySchedule::new(INITIAL_DELAY);
```

which is needlessly verbose, since the schedule already keeps track
of its initial delay.
2022-04-04 12:32:18 -04:00
Nick Mathewson 86c59dd1f3 circmgr: Avoid a race condition in circuit usage restriction
We were treating restrict_mut() failures as internal errors, and
using internal errors to represent them.  But in fact, these
failures are entirely possible based on timing.  Here's how it
happens:

* Two different circuit requests arrive at the same time, and both
  notice a pending circuit that they could use.
* The pending circuit completes; both pending requests are notified.
* The first request calls restrict_mut(), and restricts the request
  in such a way that the second couldn't use it.
* The second request calls restrict_mut(), and gets a failure.

Because of this issue, we treat these errors as transient failures
and just wait for another circuit.

Closes #427.

(This is not a breaking API change, since `AbstractSpec` is a
crate-private trait.)
2022-04-04 11:14:52 -04:00
Nick Mathewson 58a1e89c8d rtmock: add the ability to make a connection time out. 2022-04-02 15:48:41 -04:00
Nick Mathewson 3103549cba socksproto: remove some unused accessors. 2022-04-02 12:01:20 -04:00
Nick Mathewson 4a3df6a26f Clean out semver_status.md 2022-04-01 11:18:35 -04:00
Nick Mathewson ea520898fd Implement Ord for Ed25519Identity. 2022-03-30 10:39:09 -04:00
Nick Mathewson b28863f03d Update semver_status from recent round of movement. 2022-03-30 10:39:09 -04:00
Nick Mathewson 80b65c3a4d Move fallback.rs into guardmgr.
This is the logical place for it, I think: the GuardMgr's job is to
pick the first hop for a circuit depending on remembered status for
possible first hops.  Making this change will let us streamline the
code that interacts with these objects.
2022-03-30 10:34:48 -04:00
eta ac64bdea27 Make daemon tasks self-contained; introduce NetDirProvider
The various background daemon tasks that `arti-client` used to spawn are
now handled inside their respective crates instead, with functions
provided to spawn them that return `TaskHandle`s.

This required introducing a new trait, `NetDirProvider`, which steals
some functionality from the `DirProvider` trait to enable `tor-circmgr`
to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it
can't depend on `DirProvider` directly).

While we're at it, we also make some of the tasks wait for events from
the `NetDirProvider` instead of sleeping, slightly increasing
efficiency.
2022-03-30 14:26:43 +01:00
Nick Mathewson 791394cd2b Merge branch 'netinfo-clock-skew' into 'main'
tor-proto: add the ability to learn clock skew from NETINFO cells

See merge request tpo/core/arti!410
2022-03-23 12:49:36 +00:00
Nick Mathewson 0b2cf533ee tor-proto: better errors when handshake fails due to untimely certs
We now check the handshake certificates unconditionally, and only
report them as _expired_ as a last resort.

(Rationale: if somebody is presenting the wrong identity from a year
ago, it is more interesting that they are presenting the wrong ID
than it is that they are doing so with an expired cert.

We also now report a different error if the certificate is expired,
but its expiration is within the range of reported clock skew.

(Rationale: it's helpful to distinguish this case, so that we can
blame the failure on possible clock skew rather than definitely
attributing it to a misbehaving relay.)

Part of #405.
2022-03-23 08:24:36 -04:00
Nick Mathewson 3885a2c05b tor-proto: add a backend to detect reported clock skew.
NETINFO cells, which are sent in every handshake, may contain
timestamps.  This patch adds an accessor for the timestamp in the
Netinfo messages, and teaches the tor-proto code how to compute the
minimum clock skew in the code.

The computation isn't terribly precise, but it doesn't need to be:
Tor should work fine if your clock is accurate to within a few
hours.

This patch also notes a Y2038 problem in the protocol: see
torspec#80.

Part of #405.
2022-03-23 08:24:36 -04:00
Nick Mathewson acfa0f7770 dirclient: Collect and expose peer information from errors.
This commit refactors the dirclient error type into two cases:
errors when constructing a circuit, and errors that occur once we
already have a one-hop circuit.  The latter can usually be
attributed to the specific cache we're talking to.

This commit also adds a function to expose the information about
which directory gave us the info.
2022-03-21 09:06:32 -04:00
Nick Mathewson d38aafa054 Expose more peer information from circuit build failures
We already have the ability to get peer information from ChanMgr
errors, and therefore from any RetryErrors that contain ChanMgr
errors.

This commit adds optional peer information to tor-proto errors, and
a function to expose whatever peer information is available.
2022-03-21 09:06:32 -04:00
Nick Mathewson d778a92225 circmgr: Change API for using FallbackDirs
It'll soon more convenient to pass in FallbackDirs as a slice of
references, rather than just a slice of FallbackDirs: I'm going to
be changing how we handle these in tor-dirmgr.
2022-03-21 09:06:32 -04:00
Ian Jackson 25dab822f1 Add semver note 2022-03-18 16:49:25 -04:00
Nick Mathewson d39557b851 Define accessors for circuit hops.
Closes #415
2022-03-17 12:36:57 -04:00
Nick Mathewson 2c5d985227 Update semver_status.md for isolation changes 2022-03-17 08:50:30 -04:00
Ian Jackson a5ea3533c5 semver notes. 2022-03-16 19:38:12 +00:00
trinity-1686a b7daa9ff12 add integration test and fill semver_status 2022-03-14 21:19:19 +01:00
Nick Mathewson f23fca5e93 Merge branch 'testing-docs' into 'main'
New documents to checkpoint my work on #329 and #87

See merge request tpo/core/arti!407
2022-03-14 17:27:42 +00:00
eta 331da62712 Apply 1 suggestion(s) to 1 file(s) 2022-03-14 17:11:49 +00:00
Nick Mathewson 8f430fd58d Merge branch 'main' into 'intern-more'
# Conflicts:
#   doc/semver_status.md
2022-03-14 14:19:44 +00:00
Nick Mathewson 34c209c20e New documents to checkpoint my work on #329 and #87
These documents explain how to profile arti for CPU and memory, and
how to simulate different kinds of breakage and misconfiguration.

They aren't at all in their final form, but I figure it's useful to
check them in so that more people can look at them, and make
suggestions.
2022-03-14 10:14:34 -04:00
Ian Jackson dbd7388991 humantime_serde_option: Add note about semver 2022-03-14 10:34:28 +00:00
Nick Mathewson a98ae2a1f0 Canonicalize and intern protover lines on descriptors
This should save around 1MB per consensus, since every relay has a
'protocols' lines, but there are only a few distinct possibilities
for such a line.

Closes #385.
2022-03-11 16:56:12 -05:00