Nick Mathewson
fd8915155e
Merge branch 'ignore' into 'main'
...
Do not .gitignore crates/*/fuzz/corpus
See merge request tpo/core/arti!982
2023-01-20 18:47:20 +00:00
Ian Jackson
5c76bca692
tor-llcrypto: Tolerate some warnings (fmt)
2023-01-20 17:29:45 +00:00
Ian Jackson
4e6f5b7ff3
Do not .gitignore crates/*/fuzz/corpus
...
These are symlinks which are actually checked in. They should not be
ignored. (This caused trouble for some of my privsep tooling...)
2023-01-20 17:29:00 +00:00
Ian Jackson
bd21d23279
tor-llcrypto: Tolerate some warnings
...
Without this,
cargo +stable clippy -p tor-netdoc --all-features
produces warnings.
2023-01-20 16:37:31 +00:00
Nick Mathewson
131775bf36
Upgrade to latest rsa crate.
2023-01-20 08:06:30 -05:00
Nick Mathewson
02a1f9a3e4
Upgrade to latest async-broadcast
...
(We don't yet use the code that uses it, but we might as well have
our unused code be up-to-date.)
2023-01-20 08:06:30 -05:00
Nick Mathewson
707efc944d
upgrade to latest serial_test
2023-01-20 08:06:30 -05:00
Nick Mathewson
889206cde4
Complete our migration to base64ct.
...
This is in lieu of upgrading to the latest base64 crate, which has
a different API from the old one. Since we have to migrate either
way, we might as well use base64ct everywhere.
I don't think that most of these cases _require_ constant-time
base64, but it won't hurt.
2023-01-20 08:06:30 -05:00
Nick Mathewson
6cb0528cc1
Upgrade to latest rlimit crate.
2023-01-19 14:10:54 -05:00
Neel Chauhan
66a649f5f8
Prop304: Add extended SOCKS result codes for onion services
2023-01-18 18:39:00 -08:00
Michael van Straten
fa93f6674d
made TorClient::set_stream_prefs public
2023-01-18 18:20:59 +01:00
Nick Mathewson
12845d6e1e
tor-proto: Draft API to handle incoming BEGIN requests.
...
Onion services (and later, exits and caches) will need this.
2023-01-17 15:20:03 -05:00
Nick Mathewson
e8ed46006e
tor-proto: Expose support for doing onion service handshakes
...
This is a little tricky, but I think that we're not actually
exposing too much here. I expect we'll need to tweak this stuff
between now and our final version.
2023-01-17 15:20:03 -05:00
Nick Mathewson
99fdaa7c2e
tor-proto: Draft APIs for handling control messages
...
We will need these for onion services, to send and receive messages
of types not handled directly by the tor-proto crate.
2023-01-17 15:20:03 -05:00
Nick Mathewson
4fedd301cf
tor-proto: Rename "hs" experimental feature to "onion-common"
...
(For consistency with other crates)
2023-01-17 15:20:03 -05:00
Nick Mathewson
56cb2d2a10
Make a top-level API for connecting to onion services.
...
Fortunately, it adds very little to the arti-client API surface.
2023-01-12 09:28:58 -05:00
Nick Mathewson
7030cbe460
Merge branch 'onion-netdir-apis' into 'main'
...
Add onion service APIs to tor-netdir
See merge request tpo/core/arti!966
2023-01-11 16:08:18 +00:00
Nick Mathewson
de3f10f492
netdir: add network parameters related to onion services
...
These are available unconditionally, since they represent
comparatively little storage and processing effort.
See param-spec.txt section 8 for the original information here.
2023-01-11 09:10:08 -05:00
Nick Mathewson
136f70545d
tor-units: Add an IntegerMinutes.
2023-01-11 09:10:08 -05:00
Nick Mathewson
5b74ef7af9
Adjust onion service ring APIs in light of prop#342
...
* It is the NetDir's responsibility to tell the caller what the time
period is.
* There can be up to two secondary time periods.
* Each time period has a single SRV.
* Secondary time periods only apply for onion services, when they
publish.
* When publishing, the correct input is a time period.
2023-01-11 09:04:13 -05:00
Nick Mathewson
f24f8d295c
Sketch APIs for the onion service directory ring.
...
These are a bit complex internally, but the API they present is
pretty simple. I've left some discussion of points where the design
isn't totally fleshed out, and where we need to look harder at the
spec.
Part of #716 .
2023-01-11 09:04:13 -05:00
Nick Mathewson
2c41321710
Netdoc: Refactor SharedRandVal.
...
SharedRandVal now holds only the 32-byte random value itself; the
"number of commits" field is in SharedRandStatus.
This commit also makes the SharedRandVal be exactly 32 bytes, since
we've set it to that value in the spec.
2023-01-11 09:04:12 -05:00
Nick Mathewson
d7abced11f
hscrypto: Add several derives
...
The important addition here is the Copy derives, which affect API
design. I'm applying them to the types that are 32 byte or smaller.
2023-01-11 09:04:12 -05:00
Ian Jackson
d6800bae0c
Merge branch 'blind_privkey' into 'main'
...
llcrypto: Implement secret-key blinding.
Closes #719
See merge request tpo/core/arti!964
2023-01-09 18:06:00 +00:00
eta
cea6396513
Merge branch 'typos' into 'main'
...
Fix typos
See merge request tpo/core/arti!965
2023-01-09 14:44:00 +00:00
eta
371bcdc554
Merge branch 'arti-hyper-fixing-715' into 'main'
...
Temporary fix for #715 and #569
Closes #715
See merge request tpo/core/arti!958
2023-01-09 14:43:37 +00:00
Dimitris Apostolou
892c6eaadf
Fix typos
2023-01-07 20:35:54 +02:00
Michael van Straten
2e8c38d11d
Removed unnecessary "all()" cfg constraint
2023-01-07 13:00:40 +01:00
Michael van Straten
90a25fa21a
Added x86_64-apple-darwin to fallback to "tls-api-openssl"
2023-01-07 12:57:23 +01:00
Michael van Straten
0a04851636
fixed "broken_intra_doc_link"
2023-01-06 19:43:44 +01:00
Nick Mathewson
8472acf3ac
Merge branch 'onion-api-v0.2' into 'main'
...
Onion service APIs, part 1.
See merge request tpo/core/arti!959
2023-01-06 18:32:36 +00:00
Ian Jackson
0c2f800ab0
Merge branch 'sensitive' into 'main'
...
tor-proto: Remove some sensitive info from errors
See merge request tpo/core/arti!934
2023-01-06 18:07:26 +00:00
Nick Mathewson
7f6e3e19a3
Sketch a solution for arti#525
2023-01-06 13:03:50 -05:00
Nick Mathewson
91d9ffe0b6
Sketch out new required APIs in tor-cell
2023-01-06 13:03:50 -05:00
Nick Mathewson
9a54e01dd0
tor-cert: add a few hs TODOs
2023-01-06 13:03:50 -05:00
Nick Mathewson
eba937e54c
netdoc: Outline some basic types for encoding HsDescs.
2023-01-06 13:03:50 -05:00
Nick Mathewson
0203634ec5
Create a new tor-hscrypto crate.
...
This module has types and operations needed in multiple places
for an onion service implementation. There are a bunch of
TODO hs-crypto comments that we'll need to fill in.
2023-01-06 13:03:50 -05:00
Nick Mathewson
e650e07cd4
netdoc: note some changes we will have to make to srv
2023-01-06 13:03:50 -05:00
Nick Mathewson
7d38bbd829
llcrypto: fix a comment.
...
This described the wrong type of key.
2023-01-06 13:03:50 -05:00
Nick Mathewson
e7c87372e2
llcrypto: clarify meaning of "Identity".
...
The `Ed25519Identity` and `RsaIdentity` types are not precisely
always used as relay identifiers: they are more generally used as
_key_ identifiers.
This will become relevant as `RsaIdentity` is used for authority
keys (as in authorities' VoterInfo blocks), and as `Ed25519Identity`
is used as the identifier behind an onion service key.
2023-01-06 13:03:47 -05:00
Ian Jackson
98acafe9d1
tor-proto: rustfmt
...
Not sure why the tree didn't have this newline already. "Whatever".
2023-01-06 17:26:54 +00:00
Ian Jackson
0639b105c5
tor-proto: CreateFastWrap::decode_chanmsg: Do not report handshake
...
The debug impl prints the handshake challenge, which we should
probably treat as sensitive.
2023-01-06 17:26:54 +00:00
Ian Jackson
df2124e28f
tor-proto: impl Display for CreateResponse
...
Don't print the handshake value, but do print the display reason.
2023-01-06 17:26:54 +00:00
Ian Jackson
8c925499f8
tor-proto: When relay IDs mismatch, the IDs are sensitive in errors
2023-01-06 17:26:54 +00:00
Nick Mathewson
1e25a962a7
chanmgr: trace-level logs when launching connections.
...
Based on more temporary debugging code. Yet another part of #677 .
2023-01-06 17:19:00 +00:00
Nick Mathewson
71dfaa3125
ptmgr: Add more logs when looking/creating a PT.
...
These are also based on temporary logs that I added locally while I
was hunting bugs.
Also part of #677 .
2023-01-06 17:19:00 +00:00
Nick Mathewson
3eebe33678
ptmgr: Add more logging to IPC code.
...
This is based on logs that I added locally while I was trying to
debug some startup issues. Hopefully they'll make things easier the
next time there's something to debug.
Part of #677 .
2023-01-06 17:19:00 +00:00
eta
b525fccfb0
Merge branch 'ya-lint' into 'main'
...
tor-linkspec: Fix an unused lint
See merge request tpo/core/arti!935
2023-01-06 17:16:27 +00:00
eta
118050e54c
Merge branch 'test-lints' into 'main'
...
Add test lint blocks to all "mod test"
See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
eta
fbae20537c
Merge branch 'bug589a' into 'main'
...
Remove allow(unreachable_pub) from tor-guardmgr/src/lib.rs
Closes #589
See merge request tpo/core/arti!944
2023-01-06 17:14:03 +00:00
eta
d869676263
Merge branch 'socks-resolve-ip' into 'main'
...
resolve ip through socks by parsing them
Closes #714
See merge request tpo/core/arti!957
2023-01-06 17:08:25 +00:00
Nick Mathewson
306e72c566
llcrypto: Implement secret-key blinding.
...
Closes #719 .
Due to a difference between ed25519-dalek and ed25519-donna,
converting these secret keys directly to public keys does not work.
I've documented this in a "Limitations" section.
2023-01-06 12:02:49 -05:00
eta
246a5f1e56
Merge branch 'ctbytes' into 'main'
...
Add a new "CtByteArray" type, and use it in Id types.
See merge request tpo/core/arti!962
2023-01-06 16:41:29 +00:00
Nick Mathewson
9d3f19fd38
Add a new "CtByteArray" type, and use it in Id types.
...
This type provides a common implementation for types that are
implemented as arrays of bytes that should only be compared
with constant-time comparisons.
2023-01-05 12:34:14 -05:00
Michael van Straten
0d05a61381
Temporary fix for #715 and #569
2023-01-05 00:00:47 +01:00
Ian Jackson
a7035d08a1
Merge branch 'tor-rtmock-rfc3399' into 'main'
...
Use parse_rfc3339() in the tor-rtmock crate
See merge request tpo/core/arti!943
2023-01-04 14:32:13 +00:00
Ian Jackson
8f91bc5ef9
Merge branch 'tor-proto-use-rfc3339' into 'main'
...
Use parse_rfc3339() in the tor-proto crate
See merge request tpo/core/arti!942
2023-01-04 14:31:07 +00:00
Ian Jackson
0ac7dfbd9e
Merge branch 'tor-netdoc-rfc3399' into 'main'
...
Use parse_rfc3339() in the tor-netdoc crate
See merge request tpo/core/arti!941
2023-01-04 14:30:08 +00:00
trinity-1686a
29f1d9012d
resolve ip through socks by parsing them
2023-01-03 17:53:16 +01:00
Emil Engler
8579bc66a8
doc: consistent summary line for the READMEs
...
This commit introduces a consistency to the summary line of all
README.md files in each and every crate.
2022-12-20 14:31:47 +01:00
Neel Chauhan
e39e39ea27
Add semver.md for (into_)handshake()
2022-12-19 08:25:15 -08:00
Neel Chauhan
b649a1d86f
msg::{CreateFast/CreatedFast}: Rename accessor to (into_)body()
2022-12-18 21:00:24 -08:00
Neel Chauhan
23db2944cc
Remove allow(unreachable_pub) from tor-guardmgr/src/lib.rs
...
Closes #589
2022-12-16 13:23:57 -08:00
Neel Chauhan
11958c9241
Use parse_rfc3339() in the tor-rtmock crate
2022-12-16 13:07:49 -08:00
Neel Chauhan
a180f911bd
Use parse_rfc3339() in the tor-netdoc crate
2022-12-16 12:56:00 -08:00
Neel Chauhan
c171c0f834
Use parse_rfc3339() in the tor-proto crate
2022-12-16 12:53:50 -08:00
Ian Jackson
fa5a417fc9
Merge branch 'err-dyn-report' into 'main'
...
Error logging (ErrorReport, .report()) POC
See merge request tpo/core/arti!936
2022-12-15 15:02:17 +00:00
Ian Jackson
8a28cb2d14
tor-error: tests: Add a test case for Report and Bug wrapping
2022-12-15 14:37:08 +00:00
Ian Jackson
125a455bdc
test lint blocks: Add many many automatically
...
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Ian Jackson
baf78361e8
test lint blocks: Do some semi-manually
...
This is the hunks from running the rune in maint/adhoc-add-lint-blocks
but which require some subsequent manual fixup: usually, deleting
now-superfluous outer allows, but in some cases manually putting back
lints that the adhoc script deleted.
2022-12-12 18:00:29 +00:00
Ian Jackson
ec7720ae91
test lint blocks: Standardise one in tor-socksproto
...
The previous syntax was recognised by the real script, but not by the
ad-hoc script I'm about to use to add all the missing ones.
2022-12-12 17:50:39 +00:00
coral
25f113b8b3
Tackling issue #663 (Use humantime in tests)
2022-12-12 17:41:22 +00:00
Ian Jackson
4181ccb8cc
tor-circmgr: Use ErrorReport on a logged error
...
To demonstrate what the use looks like.
2022-12-12 16:40:51 +00:00
Ian Jackson
b132536b32
tor-error: Provide ErrorReport extension trait with .report() method
2022-12-12 16:40:51 +00:00
Ian Jackson
bd46e2ae84
tor_error: Promote internal StdError alias to report
...
The std::error::Error repetition was getting rather repetitively
repetitious, and is about to get more so.
2022-12-12 16:40:51 +00:00
Ian Jackson
8fea4dd6d3
tor-proto: reactor tests: Use debug fmt on an error
...
In tests, debug fmt is usually appropriate.
Found while looking for a candidate for
https://gitlab.torproject.org/tpo/core/arti/-/issues/680
2022-12-12 16:40:51 +00:00
Ian Jackson
05ca80950e
tor-linkspec: Fix an unused lint
...
Otherwise:
cargo +stable clippy -p tor-proto --all-features --all-targets
Produces:
warning: unused import: `PtTargetAddr`
--> crates/tor-linkspec/src/traits.rs:9:28
|
9 | use crate::{ChannelMethod, PtTargetAddr, RelayIdRef, RelayIdType, RelayIdTypeIter};
| ^^^^^^^^^^^^
2022-12-12 15:08:31 +00:00
Ian Jackson
5611d5cb0c
Rename Sensitive::into_inner() from ::unwrap()
...
By analogy with similar methods on Mutex, Cell, BufReader, etc. etc.
Discussed here
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/890#note_2856885
Make it a method, as per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/928
2022-12-12 11:52:34 +00:00
Dimitris Apostolou
7c1beb6171
Fix typos
2022-12-09 11:57:36 +02:00
Nick Mathewson
dc2c00e282
Merge branch 'doc-config-must' into 'main'
...
tor-config: Document how to reject compiled-out features
Closes #654
See merge request tpo/core/arti!929
2022-12-07 13:20:09 +00:00
Nick Mathewson
64ea12d4b9
Merge branch 'shewllexpand' into 'main'
...
tor-config: Update to shellexpand 3.x
See merge request tpo/core/arti!927
2022-12-07 13:19:39 +00:00
Ian Jackson
4e74104e70
Merge branch 'spelling-20221206' into 'main'
...
A few spelling fixes for bridgedescmgr code
See merge request tpo/core/arti!925
2022-12-06 18:25:43 +00:00
Ian Jackson
d88e890583
Merge branch 'persist_err_test' into 'main'
...
Test a couple more error cases in tor-persist, and lightly refactor
See merge request tpo/core/arti!930
2022-12-06 16:38:28 +00:00
Ian Jackson
fe5aeed41f
Merge branch 'safelog_tests' into 'main'
...
More unit tests for safelog crate
See merge request tpo/core/arti!928
2022-12-06 16:17:44 +00:00
Ian Jackson
2321d0ba0b
Merge branch 'faravahar-removal' into 'main'
...
dirauth: Remove Faravahar
See merge request tpo/core/arti!924
2022-12-06 16:02:22 +00:00
Nick Mathewson
764eecabab
Test a couple more error cases in tor-persist.
2022-12-06 10:55:26 -05:00
Ian Jackson
dc3c7651ca
tor-config: Document how to reject compiled-out features
...
Fixes #654
2022-12-06 15:51:43 +00:00
Ian Jackson
f3fa77be6f
tor-config: Add "particular situations" sections and mention list_builder
2022-12-06 15:51:31 +00:00
Nick Mathewson
3ab548eb1c
safelog: tests for accessors.
2022-12-06 10:31:40 -05:00
Nick Mathewson
417dda9547
safelog: tests for BoxSensitive.
2022-12-06 10:28:53 -05:00
Ian Jackson
ba338bdf37
tor-config: Update to shellexpand 3.x
...
This is the new upstream version (published by me, recently).
It has the same MSRV and one breaking change:
The caller who specifies a home dir function for substituting into
strings, must now supply a string, not Path. Previously shellexpand
would allow the caller to supply non-unicode data, and then simply not
substitute it. That was an infelicity in the shellexpand API.
Now this infelicity is pushed into our code. The overall behaviour of
Arti hasn't changed as a result. And it seems reasonable to me.
shellexpand 3.x also has a module for expanding Paths instead, in
response to requests for this filed as upstream tickets. We *could*
use that but I am not sanguine about that approach: the Pathness would
spread throughout much of our config and file handling code.
I think we should at the very least postpone trying to work with
invalid-unicode-paths as long as we can.
2022-12-06 15:15:22 +00:00
Ian Jackson
010ffd6ea6
tor-config: home dir handling: fmt pre-patch
2022-12-06 15:11:58 +00:00
Nick Mathewson
993b4202c7
safelog: more tests for Redacted.
2022-12-06 09:34:26 -05:00
Nick Mathewson
f204eebf11
arti-client: spelling fix.
2022-12-06 09:08:26 -05:00
Nick Mathewson
02d340e4b2
dirmgr: Spelling fixes and normali[sz]ations
2022-12-06 09:02:48 -05:00
David Goulet
5ea8c8eed0
dirauth: Remove Faravahar
...
See https://gitlab.torproject.org/tpo/core/tor/-/issues/40688
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-12-06 09:01:34 -05:00
David Goulet
43aa24b231
dirauth: New v3 identity key for moria1
...
We are rotating moria1's key due to a break-in few weeks ago. See
https://gitlab.torproject.org/tpo/core/tor/-/issues/40722 for more
details.
The original MR for C-tor (tor.git) done by Roger Dingledine, moria1's
operator, is here:
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/662
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-12-06 08:42:09 -05:00
eta
16305a6415
Merge branch 'optional-deps-static' into 'main'
...
make use of 1.60 weak dependancy features
Closes #434
See merge request tpo/core/arti!920
2022-12-05 15:21:55 +00:00
Nick Mathewson
e0aeda3071
Remove semver.md files now that 1.1.0 is released.
2022-11-30 17:10:29 -05:00
Nick Mathewson
40941c6079
Merge branch 'version_bump' into 'main'
...
Bump the minor version of every crate.
See merge request tpo/core/arti!918
2022-11-30 20:54:15 +00:00
trinity-1686a
39fffd8d03
make use of 1.60 opt dependancy features
2022-11-30 21:24:04 +01:00
Nick Mathewson
38bef96b99
Bump the minor version of every crate.
...
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson
82f877ec79
Hang onto a PT object after it is launched
...
If we don't do this, then snowflake's stdin will get closed and
it will exit immediately.
Found while investigating #333 .
2022-11-30 14:44:14 -05:00
Nick Mathewson
903571353b
Merge branch 'renaming' into 'main'
...
Renaming a couple of items for arti 1.1.0
Closes #623
See merge request tpo/core/arti!916
2022-11-30 18:58:37 +00:00
Nick Mathewson
6bd0f92c15
Downgrade a "TODO pt-client" comment
2022-11-30 13:22:54 -05:00
Nick Mathewson
ed08cce1b5
Rename for_circuit_usage => as_relay_with_desc
2022-11-30 13:16:51 -05:00
Nick Mathewson
acc2de7b31
Rename TransportHelper => TransportImplHelper.
2022-11-30 13:05:46 -05:00
Ian Jackson
17ba4a1cc2
Merge branch 'redacted_test_serial' into 'main'
...
safelog: Apply #[serial] to test_redacted()
Closes #675
See merge request tpo/core/arti!914
2022-11-30 17:38:12 +00:00
eta
e13f2cf7d9
Merge branch 'ptmgr-todos' into 'main'
...
Dispose of ptmgr TODOs (and remove a dead variable)
See merge request tpo/core/arti!912
2022-11-30 17:37:47 +00:00
Nick Mathewson
a0e1b3d651
Merge branch 'bridge-addr-2' into 'main'
...
Separate BridgeAddr and PtTargetAddr
See merge request tpo/core/arti!904
2022-11-30 17:36:50 +00:00
eta
5c2847e1d0
Merge branch 'fix_pt_protocol' into 'main'
...
Resolve two bugs in our pt-socks implementation
Closes #676
See merge request tpo/core/arti!913
2022-11-30 17:25:31 +00:00
Ian Jackson
8157cf059e
Merge branch 'abolish-set-default-transport' into 'main'
...
Abolish ChanMgr::set_default_transport
See merge request tpo/core/arti!910
2022-11-30 17:05:36 +00:00
Nick Mathewson
4688ee9165
safelog: Apply #[serial] to test_redacted()
...
Closes #675 .
2022-11-30 12:00:17 -05:00
Nick Mathewson
e835bd4c4c
PT protocol: pt-spec conformance with password field
...
pt-spec says:
```
If the encoded argument list is less than 255 bytes in
length, the "PLEN" field must be set to "1" and the "PASSWD"
field must contain a single NUL character.
```
This is a very silly thing to say, but some PTs enforce it.
Fixes #676 .
2022-11-30 11:53:38 -05:00
Nick Mathewson
475d9af34a
connect_via_proxy: Actually send initial handshake.
...
Our previous code would make a TCP connection to the proxy, then
wait forever for it to say something. Whoops!
Part of a fix for #676 .
2022-11-30 11:53:27 -05:00
Ian Jackson
fa676ce577
ptmgr todo: Remove dead code allow
2022-11-30 16:42:40 +00:00
Ian Jackson
fe33112923
ptmgr: No need for state_dir in PtMgr
...
This is used exclusively by the reactor.
2022-11-30 16:42:18 +00:00
Ian Jackson
1521f63bf1
ptmgr todo: Tolerate exposing the Vec for now
...
We may want to change this later, but this API is in a low level
crate, so this isn't a blocker.
2022-11-30 16:40:45 +00:00
Ian Jackson
4afe128189
PT SOCKS tests: add a few more tests
2022-11-30 16:35:04 +00:00
Ian Jackson
596e67f588
PT SOCKS tests: test name that only fits in V4
2022-11-30 16:35:04 +00:00
Nick Mathewson
a5cdf88fdc
Merge branch 'pt-todo-highlevel' into 'main'
...
Dispose of all TODO pt-client in arti-*
See merge request tpo/core/arti!909
2022-11-30 16:22:46 +00:00
eta
f122b4b1ee
Merge branch 'no_empty_select' into 'main'
...
ptmgr: Do not construct an empty select_all future.
Closes #672 and #670
See merge request tpo/core/arti!907
2022-11-30 16:01:58 +00:00
Ian Jackson
ab74506dc9
Abolish ChanMgr::set_default_transport
...
The comment says
// TODO pt-client: It's not clear to me that we really need this method.
and empirically, deleting it, and its callee, is fine.
2022-11-30 16:00:31 +00:00
Ian Jackson
e068c5c2bc
Merge branch 'ptmgr-errs' into 'main'
...
ptmgr: error fixes
See merge request tpo/core/arti!906
2022-11-30 15:58:26 +00:00
Ian Jackson
e6d721c497
arti: transports parsing: Record this as a ticket
2022-11-30 15:56:16 +00:00
Ian Jackson
598f4e2e28
arti: BridgesConfig is evidently not too high up
...
Since apparently it was possible to write all the other code without
moving it.
2022-11-30 15:51:10 +00:00
Ian Jackson
e4ac39e638
bridge config: Add a TODO about a redundant clone
2022-11-30 15:49:34 +00:00
Ian Jackson
429d2c7cb7
bridge config: Rename accessors
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858480
2022-11-30 15:49:34 +00:00
Ian Jackson
117bee5808
bridge config: Use unreachable, not None.expect
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/904#note_2858479
2022-11-30 15:49:34 +00:00
Ian Jackson
bb6c98bdc1
BridgeAddr tests: dedupe slightly
2022-11-30 15:49:34 +00:00
Ian Jackson
199a6e0754
Separate BridgeAddr and PtTargetAddr
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220
This commit is difficult to split up.
The innards of BridgeAddr and PtTargetAddr are still a bit entangled.
2022-11-30 15:49:34 +00:00
Ian Jackson
a74ee097f5
arti: pt mgr spawns the task itself in new
2022-11-30 15:48:31 +00:00
Ian Jackson
455295457f
Merge branch 'redaction_fix' into 'main'
...
Fix a logic error in Redacted.
Closes #671
See merge request tpo/core/arti!905
2022-11-30 15:39:41 +00:00
Nick Mathewson
d853fdb5cb
ptmgr: Do not construct an empty select_all future.
...
Closes #670 .
Closes #672 .
2022-11-30 10:22:09 -05:00
Ian Jackson
1e63a89ce8
ptmgr: change error UnconfiguredTransportDueToConcurrentReconfiguration
...
Rename it from UnconfiguredTransport. Change descriptions, kind, and
retry. Add a TODO.
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858455
2022-11-30 15:21:49 +00:00
Ian Jackson
d705454313
ptmgr: Clarify E::NotAFile
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858454
2022-11-30 15:21:39 +00:00
Ian Jackson
f19d8e0397
ptmgr: Fix kind for E::StatedirCreateFailed
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/901#note_2858456
2022-11-30 15:21:39 +00:00
Nick Mathewson
80d9248b50
Merge branch 'merge_ptreactor' into 'main'
...
Merge PtReactor, resolve a few of my comments.
See merge request tpo/core/arti!903
2022-11-30 15:21:13 +00:00
Nick Mathewson
f0084e3fd4
Fix a logic error in Redacted.
...
Previously it was redacting exactly when safelogging was _disabled_,
which obviously isn't correct.
Fixes #671 . Regression test included.
2022-11-30 09:07:33 -05:00
Nick Mathewson
dacb3eafda
ptmgr: report an error if PT transports don't match requested.
...
(I think this may be impossible now, since we check in ipc.rs, but
IMO it's best to check.)
2022-11-29 20:01:19 -05:00
Nick Mathewson
5f0f5f81b1
arti-client: Try to take ownership of state earlier.
...
There's no harm in doing this, since we'll try to take ownership of
the state soon as soon as we use it: We just want to try early, so
that we'll get it before we decide that we're using bridges.
Fixes bug #669 ; bug introduced by !889 .
2022-11-29 19:58:42 -05:00
Nick Mathewson
fdc49b1fed
Register transport in pt reactor even if it has no pending requests
2022-11-29 19:35:38 -05:00
Nick Mathewson
9765fdc2e6
ptmgr: Use anonymize_home when displaying paths in errors
2022-11-29 19:30:50 -05:00
Nick Mathewson
f6311c83f7
ptmgr: Use PluggableTransport::identity in logs.
...
This lets us avoid logging the user's path.
2022-11-29 19:20:44 -05:00
Nick Mathewson
bb0749cd42
Centralize the "find an identifier for the pt name" logic in one place.
2022-11-29 19:13:32 -05:00
Nick Mathewson
21e7e52ad5
Merge remote-tracking branch 'eta/ptreactor-v1' into merge_ptreactor
...
Resolved several conflicts while doing so; mostly with !893 and
!895 .
2022-11-29 18:55:49 -05:00
eta
9b4fc50625
tor-ptmgr: add PtReactor
...
This fleshes out the PtReactor that was previously a stub, making it
actually do reactor-ey things. Note that this is entirely untested, and
might not work at all. Hopefully it does, though.
2022-11-29 20:13:32 +00:00
Nick Mathewson
7ef9dde99c
Merge branch 'todos-chanmgr' into 'main'
...
chanmgr: resolve several remaining "TODO pt-client" issues
See merge request tpo/core/arti!897
2022-11-29 19:31:48 +00:00
Nick Mathewson
dc5551114c
Merge branch 'list-builder-lint' into 'main'
...
tor-basic-utils: list_builder: Use standard test lint block
See merge request tpo/core/arti!900
2022-11-29 19:25:07 +00:00
Ian Jackson
f3c8b0433b
tor-basic-utils: list_builder: Use standard test lint block
...
This gets rid of a spurious warning on nightly about the use of dbg!
2022-11-29 18:41:56 +00:00
Nick Mathewson
bdddb78828
Merge branch 'more-linkspec-tests' into 'main'
...
Add tests for a bunch of code in tor-linkspec
See merge request tpo/core/arti!867
2022-11-29 18:41:54 +00:00
Nick Mathewson
8cc09c2728
chanmgr: Distinguish failure to connect to proxy from other IO failures
2022-11-29 13:41:35 -05:00
Ian Jackson
c3bdb30025
Merge branch 'ptmgr-optional-dep-test' into 'main'
...
MultilineListBuilder etc.: add serde tests
See merge request tpo/core/arti!899
2022-11-29 18:37:43 +00:00
Ian Jackson
b36a23cfd3
Merge branch 'ptmgr-optional-dep' into 'main'
...
Support building without pluggable transports
Closes #649
See merge request tpo/core/arti!898
2022-11-29 18:26:30 +00:00
Ian Jackson
303fafe81b
Merge branch 'll-todo-fixes' into 'main'
...
Fix and resolve TODO pt-client comments in guardmgr, linkspec.
See merge request tpo/core/arti!896
2022-11-29 18:14:25 +00:00
Ian Jackson
cdc1e574f9
tor-config MultilineListBuilder: Test deserialisation
2022-11-29 17:53:04 +00:00
Ian Jackson
255f3b6bf6
tor-config MultilineListBuilder: Print line number starting at 1, not 0
2022-11-29 17:53:04 +00:00
Ian Jackson
ef07c2e99d
tor-config list_builder tests: Move Outer up a level
...
We're going to reuse this.
2022-11-29 17:53:04 +00:00
Ian Jackson
211a832f6d
Clarify internal error.
2022-11-29 17:22:16 +00:00
Ian Jackson
143b331ef7
arti-client: Make ptmgr actually optional
2022-11-29 16:32:14 +00:00
Ian Jackson
1bd606ab5c
guardmgr: Conditionalise DisplayRule::Redacted
...
This is unused in bridgeless configs. Fixes a compiler warning.
2022-11-29 16:32:14 +00:00
Ian Jackson
c92dcb5f50
arti, arti-client: Conditionalise various things on pt-client
2022-11-29 16:32:14 +00:00
Ian Jackson
d05d383fa5
arti cfg tests: Add some more debug output
2022-11-29 16:32:14 +00:00
Ian Jackson
71e81bf7b4
MultilineListBuilder: Use a manual implementation of Deserialize
...
The error message from `#[serde(untagged)]` would otherwise start to
appear when we try to deserialise unsupported PT configurations, when
compiled with bridge but not PT support.
2022-11-29 16:32:14 +00:00
Nick Mathewson
c6aa587dc8
chanmgr: remove a now-stale TODO.
2022-11-29 11:15:36 -05:00
Nick Mathewson
4fff9f9dda
chanmgr: Report Pt errors correctly.
...
We were panicking if the PtMgr gave us an error, which isn't so
good.
2022-11-29 11:10:26 -05:00
Nick Mathewson
6b12c5d1de
guardmgr: remove todo about bridge::config::Inner members
...
We've revised this a few times; now it seems plausible.
2022-11-29 11:03:44 -05:00
Nick Mathewson
0c0f3d1faf
guardmgr: Remove now-unneeded #[allow(unnecessary_wraps)]
2022-11-29 11:00:27 -05:00
Nick Mathewson
69744ef8f3
Remove deprecated aliases in tor-linkspec.
2022-11-29 10:56:59 -05:00
Nick Mathewson
75cba2ce80
ptmgr: Refine RetryTime for ChildSpawnFailed.
2022-11-29 10:44:09 -05:00
Nick Mathewson
29ea66ecb9
ptmgr: Rename ClientTransportFailed, document, and correct its RetryTime.
2022-11-29 10:42:26 -05:00
Nick Mathewson
d9dc30bc13
ptmgr: Replace StdioUnavailable with a PtError.
2022-11-29 10:36:51 -05:00
Nick Mathewson
7f923b9dfe
Rename LocalLoginFailed to ExternalToolFailed.
2022-11-29 10:32:59 -05:00
Nick Mathewson
eebfe8300e
Document better what LocalProtocolViolation does not cover.
2022-11-29 10:29:54 -05:00
Nick Mathewson
f08cfb6567
Merge branch 'ptmgr-cleanup' into 'main'
...
Post-merge cleanups for PtMgr
Closes #667 and #659
See merge request tpo/core/arti!893
2022-11-29 14:46:55 +00:00
Nick Mathewson
9a17a6a8aa
Switch from sha-1 back to sha1.
...
As near as I can tell, the rust-crypto SHA1 crate was called `sha-1`
for a while because of a conflict with a different SHA1 crate. Now
they apparently have the `sha1` name back and have deprecated the
`sha-1` name.
2022-11-29 08:24:58 -05:00
eta
3a0f0a909d
Spelling fix in arti_client::err
2022-11-29 12:31:50 +00:00
Ian Jackson
8835c1b170
Merge branch 'redacted' into 'main'
...
Define a "redactable" trait, and use it when logging guard info
Closes #648 and #627
See merge request tpo/core/arti!882
2022-11-29 12:29:48 +00:00
Ian Jackson
d78295929b
Merge branch 'more_netdoc_tests' into 'main'
...
tor-netdoc: More tests for routerdesc accessors and parsing.
See merge request tpo/core/arti!870
2022-11-29 11:11:47 +00:00
Nick Mathewson
1f4a385d7d
Temporarily make ptmgr required for arti-client :/
2022-11-28 17:29:32 -05:00
Nick Mathewson
820657b6bc
PtMgr: Use a persistent state directory for PT state.
...
This makes a `pt_state` directory inside .local/share/arti (or the
local equivalent), right next to our existing `state` dir.
Ideally we would use a separate directory for each PT, but we have a
very fuzzy "what is a specific PT" notion.
Closes #667
2022-11-28 17:29:32 -05:00
Nick Mathewson
1a9c4c722b
Integrate PtMgr into arti-client.
...
If support is available at compile-time, then we construct a PtMgr
and register it with the ChanMgr. We keep a handle to it ourself so
that we can reconfigure it as needed.
Closes #659 .
2022-11-28 17:29:32 -05:00
Nick Mathewson
3db0e05b39
Fix ChanMgr APIs for setting PtMgr etc to match what TorClient wants.
2022-11-28 17:29:23 -05:00
Nick Mathewson
3fa86f41a6
Revise the API of "PtMgr::reconfigure"
...
I prefer that it not take `&mut self`, since PtMgr already has
interior mutability.
I also need it to take `tor_config::Reconfigure` argument, in case
it gains any more smarts about validation in the future.
2022-11-28 17:29:23 -05:00
Nick Mathewson
c99017b0d6
ptmgr: Note a TODO issue around TempDir.
2022-11-28 17:29:23 -05:00
Nick Mathewson
4b5be3685f
ptmgr: Fill in some error-related code; resolve TODOs.
2022-11-28 17:29:23 -05:00
Nick Mathewson
1fa9296f9c
ptmgr: clear up unused_import exceptions.
2022-11-28 17:29:23 -05:00
Nick Mathewson
6bde90ce01
PtMgr: New features section in README.md
...
Per convention, have a `full` feature.
Also, downgrade the 'TODO pt-client' entries in README::limitations,
since they are not blockers for 1.1.0.
2022-11-28 17:29:23 -05:00
Nick Mathewson
8d0ac9bdc8
ptmgr: Mark PtMessage and next_message as experimental-api.
...
These are implementation details and we don't want to mark them as
stable.
To do this, I needed to apply some additional options to the example
code's configuration in Cargo.toml.
2022-11-28 17:29:23 -05:00
eta
a3c9fc5b1a
tor-chanmgr: Introduce the BootstrapReporter API, publicize ChanBuilder
...
This commit makes the `ChanBuilder` type in `tor-chanmgr` usable by
consumers outside of that crate, like the doc comment for
`ChannelFactory` says you need to be able to do in order to turn your
`TransportHelper` into something useful.
As part of doing this, the `event_sender` its constructor takes needed
to be dealt with, since it was a crate-internal type that came from
inside the `ChanMgr`.
Enter `BootstrapReporter`: an opaque wrapper around that sender, now
provided as an additional argument to
`ChannelFactory::connect_via_transport`. You can now construct a
`ChanBuilder` outside this crate, and it'll still be able to report its
bootstrap status by unwrapping this new type that's threaded through
from the `ChanMgr`. (This was a fair deal of manually threading the type
through all the layers in this crate!)
Note that you cannot implement bootstrap updating using something that
isn't `ChanBuilder` yet due to the type being entirely opaque (but, of
course, we can figure out exactly what API the reporter should have
later, and add that capability in).
2022-11-28 13:52:21 -05:00
eta
3b41c78d6f
Draft: Pluggable transport manager
...
This commit implements `PtMgr`, a pluggable transport manager
responsible for keeping track of spawned PTs and spawning them to
satisfy client requests on demand.
It does this in two parts: the `PtMgr` type exported to the rest of the
code, and the background `PtReactor` that actually does the spawning;
this design ensures that only one attempt to spawn a PT is active at a
time, and will prove useful later for implementing e.g. timeouts.
A few changes were necessary to the rest of the code in order to make
this all work out. Namely:
- `TransportRegistry`'s API didn't make any sense for two reasons:
- It wasn't feasible for implementors to implement `ChannelFactory`,
since that'd require constructing a `ChanBuilder` (which requires a
bootstrap reporting event sender).
- Treating the PT manager as a registry is over-general; it's only
necessary for it to spawn pluggable transports, so saddling it with
other concerns didn't make any sense.
- (It's possible to get extensibility for arbitrary user customization
by just letting the user swap in a new `ChannelFactory`, anyway.)
- Therefore, the `PtMgr` implements the new `AbstractPtMgr` trait, which
is far more narrowly focused; this only exists to solve a dependency
loop, and is documented as such.
- This provides a `TransportHelper` instead of a `ChannelFactory`.
2022-11-28 13:52:21 -05:00
Nick Mathewson
5d6044f3fc
Rustdoc fix: escape []s.
2022-11-28 09:36:15 -05:00
Nick Mathewson
45c4beff7a
Fix up compatibility issues between linkspec tests and other patches
2022-11-28 08:29:33 -05:00
Nick Mathewson
777b6bee3d
linkspec: Add some tests for ChannelMethod
2022-11-28 08:20:57 -05:00
Nick Mathewson
60bc179019
linkspec: Tests for PtTargetSettings
2022-11-28 08:19:47 -05:00
Nick Mathewson
119e5f6f75
PtTransportName: Remove unused accessors.
2022-11-28 08:19:47 -05:00
Nick Mathewson
d990a23948
linkspec: Add tests for has_any_identity.
2022-11-28 08:19:45 -05:00
Nick Mathewson
145ab3c49b
linkspec: Add test for lookup on no-ids.
2022-11-28 08:19:08 -05:00
Nick Mathewson
aa72f3d8c8
Add a test for ByRelayIds::remove_by_all_ids
2022-11-28 08:19:08 -05:00
Nick Mathewson
a77172e20d
safelog: Make MaybeRedacted<T> opaque.
2022-11-28 08:01:53 -05:00
Nick Mathewson
cf9f29158f
GuardMgr: Treat Guards as sensitive and Bridges as redacted.
...
This machinery is a bit inelegant, but it is all confined to
be within the GuardMgr crate, so IMO it should be fine for now.
2022-11-28 08:01:53 -05:00
Nick Mathewson
c62958c76f
Add a default debug_redacted impl to save space.
2022-11-28 08:01:53 -05:00
Nick Mathewson
29f903bdac
Display guards in redacted form in guard status messages.
...
Closes #627 , again.
Closes #648 .
2022-11-28 08:01:53 -05:00
Nick Mathewson
2aa0ae4016
linkspec: Give a Redacted form for chantarget.
2022-11-28 08:01:50 -05:00
Nick Mathewson
8d36fa9996
llcrypto: Make key id types Redactable.
2022-11-28 08:01:10 -05:00
Nick Mathewson
f2c91ef56e
safelog: Add a MaybeRedacted wrapper too.
...
This is super helpful for cases where we want to write two nearly
identical implementations to format a type.
2022-11-28 08:01:10 -05:00
Nick Mathewson
f91218c78d
safelog: implement Redactable for network addr types.
2022-11-28 08:01:10 -05:00
Nick Mathewson
d3f4956728
safelog: Define a "Redactable" trait
...
A "redactable" object is one that can be _partially_ scrubbed in
sensitive contexts. This can be very helpful for UX, but is not
risk-free: see comments.
2022-11-28 08:01:10 -05:00
Nick Mathewson
8cf9e2a6a4
Merge branch 'chanmethod-non-exhaustive' into 'main'
...
Make ChannelMethod non-exhaustive
See merge request tpo/core/arti!891
2022-11-27 19:36:22 +00:00
Nick Mathewson
984bd6012a
Merge branch 'reconfig-bridges-bad' into 'main'
...
Require state ownership when using bridges
Closes #612
See merge request tpo/core/arti!889
2022-11-27 19:30:00 +00:00
trinity-1686a
fda17829d5
fix deprecation warnings from rustls
2022-11-26 10:23:05 +01:00
trinity-1686a
0a917a1abc
upgrade rustls to 0.20, ignoring all deprecation warnings
2022-11-26 10:23:05 +01:00
Ian Jackson
1a39a0c7e9
Make ChannelMethod non-exhaustive
...
Enums with variants conditional on cargo features must be
non-exhaustive, because cargo features are supposed to be additive,
meaning that enabling a feature (which might happen due to some random
distant thing) ought not to break things using that enum.
There were surprisingly few places to fix this.
2022-11-24 17:17:36 +00:00
Ian Jackson
04082ab7a9
tor-guardmgr: rustfmt for recent changes
...
Left unsquashed for ease of review
2022-11-24 14:31:05 +00:00
Ian Jackson
ecd0e121a8
tor-guardmgr: NoLock error: add TODO for trying to get lock
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856874
2022-11-24 14:31:05 +00:00
Ian Jackson
112e28d88e
tor-config: Rename to ReconfigureError::UnsupportedSituation
...
From Unsupported. Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873
This was added in this MR.
Also add the missing semver note.
2022-11-24 14:31:03 +00:00
Ian Jackson
fa918446ac
tor-config: Rename to ConfigBuildError::NoCompileTimeSupport
...
From Unsupported. Following one of the suggestions here
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856873
This was added in 2c37116149
which was
not yet in a release so this isn't a semver break. I have added
the semver note that was omitted in that MR.
2022-11-24 14:30:58 +00:00
Ian Jackson
90a1a10b3c
Merge branch 'sensitive-error' into 'main'
...
Scrub channel target information in errors
See merge request tpo/core/arti!890
2022-11-23 20:18:17 +00:00
Ian Jackson
dc13c93491
Merge branch 'bdm-dormant' into 'main'
...
bridge desc mgr: Honour specified dormancy
Closes #630
See merge request tpo/core/arti!861
2022-11-23 20:13:29 +00:00
Ian Jackson
6a39cdfe57
Merge branch 'watch-drop-option' into 'main'
...
tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable
See merge request tpo/core/arti!853
2022-11-23 18:55:32 +00:00
Ian Jackson
ef5a58e158
tor-dirclient: Replace OwnedChanTarget with LoggedChanTarget in SourceInfo
...
SourceInfo primarily appears in errors, here and in (indirectly)
tor-dirmgr.
This
1. Makes the errors smaller
2. Redacts (currently, scrubs) the chantarget when safe logging is enabled
This commit therefore deals with both tor-dirmgr and tor-dirclient
errors, from the pov of error information that should become sensitive
as part of bridge support.
The error pyaloads directly in tor_dirmgr/src/err.rs don't seem to
contain anything in that category.
2022-11-23 18:28:38 +00:00
Ian Jackson
b822e2ebe9
tor-cirmgr: Replace OwnedChanTarget with LoggedChanTarget in errors
...
This
1. Makes the errors smaller
2. Redacts (currently, scrubs) the chantarget when safe logging is enabled
The other error variants in tor-circmgr::Error don't seem to contain
information that should become sensitive as part of bridge support.
2022-11-23 18:28:38 +00:00
Ian Jackson
e635383dfb
tor-chanmgr: Invent [Box]ChanSensitive for two error payloads
...
This
1. Makes the errors smaller (in the case of Io's PtTargetAddr;
ChannelBuild's addresses are already indirected in a Vec).
2. Redacts (currently, scrubs) the PtTargetAddr and SocketAddr
when safe logging is enabled
These are the remaining error variants in tor-chanmgr that contain
information that should become sensitive as part of bridge support.
2022-11-23 18:28:38 +00:00
Ian Jackson
32357b3de7
tor-chanmgr: Replace OwnedChanTarget with LoggedChanTarget in errors
...
This
1. Makes the errors smaller
2. Redacts (currently, scrubs) the chantarget when safe logging is enabled
This commit doesn't treat other should-be-sensitive inforemation in
errors just yet. That will come in a moment.
2022-11-23 18:28:38 +00:00
Ian Jackson
45a79bf725
tor-linkspec: Provide LoggedChanTarget type alias and utility method
...
This makes it easy to talk about, and construct, a
BoxSensitive<OwnedChanTarget>, which is what we'll use in errors.
2022-11-23 18:28:38 +00:00
Ian Jackson
bbc84bf9f4
safelog: Provide BoxSensitive
2022-11-23 18:28:38 +00:00
Ian Jackson
4f193f1017
safelog: Remove type argument from `impl_display_traits`
...
We're going to have this same macro implement the same traits for a
second type. And its function is specific to `Sensitive`, so have it
know that.
2022-11-23 18:28:34 +00:00
Ian Jackson
b77fd893a4
safelog: Provide some more accessors
...
We're about to use `.as_inner()` in a few places, and `.as_ref()` (by
analogy with `Option`) seems obviously necessary.
2022-11-23 18:28:34 +00:00
Ian Jackson
1c085cf401
bridge desc mgr: Add dormancy comment to effective_parallelism
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/861#note_2856922
2022-11-23 18:20:58 +00:00
Ian Jackson
68acedccfd
bridge desc mgr: Test dormancy
2022-11-23 18:20:58 +00:00
Ian Jackson
e0c4eed549
bridge desc mgr: Honour specified dormancy
...
Fixes #630
2022-11-23 18:20:58 +00:00
Ian Jackson
a33df9a5f5
bridge desc mgr: Introduce effective_parallelism helper
2022-11-23 18:20:58 +00:00
Ian Jackson
2c98351e2d
bridge desc mgr: Move set_dormancy to impl that is for mock too
2022-11-23 18:20:58 +00:00
Nick Mathewson
ce0f8f41cb
Merge branch 'bridge-config-arc' into 'main'
...
Make BridgeConfig be Arc, so no Arc<BridgeConfig>
Closes #635
See merge request tpo/core/arti!885
2022-11-23 17:52:26 +00:00
Ian Jackson
fbd4b88044
Merge branch 'test-config' into 'main'
...
tor-guardmgr: Fix visibility of TestConfig with no features enabled
See merge request tpo/core/arti!875
2022-11-23 17:51:05 +00:00
Ian Jackson
4d502bd818
arti-client: Add comment about Option DormantMode
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854090
(ftaod, that is a different MR to this one)
2022-11-23 17:50:05 +00:00
Ian Jackson
c82cda85d6
tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable
...
This will help avoid the programmer making the mistake I made here:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854029
2022-11-23 17:50:05 +00:00
Nick Mathewson
c0a6fb3e0f
Merge branch 'stability' into 'main'
...
arti-client, tor-config: Remove stability warning from top-level docs
See merge request tpo/core/arti!878
2022-11-23 17:50:01 +00:00
Ian Jackson
63a799a118
tor-basic-utils: DropNotifyWatchSender test: introduce I
...
We do want to test this with a non-Option type, but we are going to
have to wrap it up.
2022-11-23 17:50:01 +00:00
Nick Mathewson
e25ed00fd1
Merge branch 'remove_deadcode_allow' into 'main'
...
guardmgr: Remove a now-unneeded "allow(dead_code)"
See merge request tpo/core/arti!862
2022-11-23 17:45:26 +00:00
Nick Mathewson
3f5699b95a
ChanMgr: Another attempt to build on CI.
2022-11-23 11:25:15 -05:00
Nick Mathewson
74ebc904e3
ChanMgr: Rename Factory -> CompoundFactory
2022-11-23 11:10:34 -05:00
Nick Mathewson
1249bedbb0
ChanMgr: Fix a few more conditional-compilation issues
2022-11-23 11:10:34 -05:00
Nick Mathewson
2fb36f5585
ChanMgr: Remove Arc aliases.
2022-11-23 11:10:34 -05:00
Nick Mathewson
f8e103bb94
Mark set-default-factory API as experimental.
2022-11-23 11:10:34 -05:00
Nick Mathewson
c04aa9baed
Make ChannelFactory and AbstractPtMgr require Send+Sync
2022-11-23 11:10:34 -05:00
Nick Mathewson
bc1de60d6d
ChanMgr: Implement functions that replace channel factories.
...
This commit makes it possible to replace the default channel factory
(used when there is no PtMgr), and to replace the PtMgr.
This is part of #659 .
2022-11-23 11:10:34 -05:00
Ian Jackson
ecaf8b23b8
tor-guardmgr: Refuse to configure bridges if we don't have the lock
...
Fixes #612
2022-11-23 13:03:14 +00:00
Ian Jackson
c0b297c99c
tor-guardmgr: make replace_bridge_config fallible
...
The error type needs to be convertible to GuardMgrError and also to
ReconfigureError. Neither of those is right, so we need a new error
type.
2022-11-23 13:00:10 +00:00
Ian Jackson
8cddb0a06a
tor-guardmgr: Replace a let _ignore with a typed version
...
`let _ignore =` isn't great because if the function called is
currently infallible, but becomes fallible, it suppresses the
detection of the error check.
A better pattern is to specify the type of the ignored value.
I'm about to do precisely this, here.
I did a git-grep and `let _ignore =` seems very common. Let's not
deal with all those now.
2022-11-23 13:00:05 +00:00
Nick Mathewson
a688e4afc9
ChanMgr: move the AbstractChanFactory into MgrState.
...
We will want the freedom to replace this, so it needs to go behind a
lock. We need to be able to Clone it cheaply now, so we're using an
Arc instead of a Box.
2022-11-22 14:41:44 -05:00
Nick Mathewson
fc74bb8bb4
Merge branch 'retire_on_guard_cfg_change' into 'main'
...
CircMgr: retire all circuits if bridge configuration changes.
Closes #650
See merge request tpo/core/arti!880
2022-11-22 19:00:20 +00:00
Nick Mathewson
09092394a8
Merge branch 'main' into 'abstract-pt-mgr'
...
# Conflicts:
# crates/tor-chanmgr/src/factory.rs
2022-11-22 18:12:25 +00:00
eta
2f75702cec
Replace TransportRegistry with AbstractPtMgr
...
It doesn't make much sense to have the pluggable transport manager be a
registry, so replace its interface with a more narrowly defined, less generic
version.
Other changes:
- instead of returning a &-reference, it returns an owned Arc, which
should make the ptmgr easier to implement while allowing efficient
reuse
- provision for error handling is added, but will probably be revised in
a future commit pending discussion
- tor-ptmgr code that would generate warnings as a result of this change
is temporarily removed
This is a split out version of arti!886, intended so work on arti#659
can proceed.
2022-11-22 18:09:06 +00:00
Nick Mathewson
f2121101d1
Even more comments explaining circuit cancellation.
2022-11-22 12:53:32 -05:00
Nick Mathewson
e7c942c918
Improve notes surrounding circuit cancellation.
...
It turns out that bug #656 is not a real bug, but it was easy to
overlook the code that prevented it.
Closes #656 .
2022-11-22 12:53:32 -05:00
Nick Mathewson
c0aa10d409
CircMgr: retire all circuits if bridge configuration changes.
...
Closes #650 .
2022-11-22 12:53:32 -05:00
Ian Jackson
ee87097dc1
BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfig
...
BridgeConfig is itself an Arc now, so these are redundant.
2022-11-22 15:33:21 +00:00
Ian Jackson
3caf7aafc0
BridgeConfig: Make it be a newtype around Arc<Inner>
...
This leaves the external API of this type unchanged, but now it's much
smaller and quite cheap to clone.
2022-11-22 15:33:21 +00:00
Ian Jackson
5d8d3f79fa
bridge config: Remove a done TODO
...
This was done by !874 and #604 closed accordingly.
2022-11-22 15:08:28 +00:00
Ian Jackson
822a6ce32b
TransportId: Fix test case for no pt-target
...
Fixes
cargo +stable clippy --manifest-path=/home/ian/Rustup/Arti/arti/Cargo.toml --locked --target-dir=target --offline -p tor-linkspec --no-default-features --all-targets
giving
446 | .method(ChannelMethod::Pluggable(PtTarget::new(
| ^^^^^^^^^ variant or associated item not found in `transport::ChannelMethod`
2022-11-22 14:59:25 +00:00
Ian Jackson
8406474435
bridge config parsing tests: Show expected error message in asssrt
2022-11-22 14:59:25 +00:00
Ian Jackson
987f67d7f6
bridge config parsing: Parse transport as TransportId (fmt)
2022-11-22 14:59:25 +00:00
Ian Jackson
e57d3061db
bridge config parsing: Parse transport as TransportId
...
Fixes #653
2022-11-22 14:59:25 +00:00
Ian Jackson
6b2940bb7d
bridge config parsing: Move unsupported block
...
This will make the next commit textually smaller.
2022-11-22 14:59:25 +00:00
Ian Jackson
28ca346297
TransportId: Parse "bridge" as builtin transport
...
This will allow transport="bridge" in bridge configurations, etc.
Doing it at this layer means it will be recognised everywhere.
2022-11-22 14:59:25 +00:00
Ian Jackson
813f0a71c9
TransportId: Provide new_builtin and new_pluggable
...
I think normal Rustic practice is to provide a real constructor as
well as just `Default`.
2022-11-22 14:59:25 +00:00
Ian Jackson
331aa673ea
TransportId: Provide name accessor and deconstructor
...
We are maintaining the notion that at some point this thing might
grow additional variants.
2022-11-22 14:59:25 +00:00
Ian Jackson
4b8010782a
TransportId: Document and change string repr for builtin
...
* Change the Display of builtin to "-"
* Parse "" and "-" as builtin, as well as "<none>"
* Document this
2022-11-22 14:59:21 +00:00
Ian Jackson
fe0970e28e
TransportId: Add test case for builtin Display repr
2022-11-22 14:59:21 +00:00
Ian Jackson
17002c7462
bridge non-support: Add doc notes to GuardMgrConfig::bridges_enabled
2022-11-21 16:46:19 +00:00
Ian Jackson
ec7f058cfd
bridge non-support: Test that we reject configs
2022-11-21 16:46:19 +00:00
Ian Jackson
b2607fd8c8
bridge non-support: De-cfg the primary bridge config fields
...
We now parse the `bridges.enabled` BoolOrAuto, and the
`bridges.bridges` list.
The `bridges.bridges` list is Vec<()> in the builder, and Vec<Void> in
the built config. Ie, it is simply a count, and vanishes in the built
config.
But this count triggers us to try to call build(), to try to parse
bridges, and to try to set and honour the enablement boolean.
The result is that the type system now ensures that if bridges are
disabled, but specified (either by listing them in the config, or
writing `enabled=true`), we inevitably try to insist that we have a
non-empty Vec<Void>, which is of course impossible.
There will be a test case too for those who think this too abstract a
way to guarantee this property :-).
2022-11-21 16:46:19 +00:00
Ian Jackson
939d11c034
bridge non-support: Provide a better BridgeConfigBuilder
...
This type now does all the things people expect of it: you can (try
to) deserialize it, parse it from a string, and call build on it.
2022-11-21 16:46:19 +00:00
Ian Jackson
c4a3b0b5c4
bridge config: Feature-gate the error variants
...
This leaves this enum empty of actual errors, when bridge-client is
disabled.
We're going to add the not supported variant in a moment.
2022-11-21 16:46:19 +00:00
Ian Jackson
5800b1cdc9
bridge config: Move error to its own file
...
The dummy module is going to need an error type just like this but
with only the disabled variant. To avoid that dummy enum getting out
of step with the nontrivial one, we're going to make them the same.
So as a first step, break this out into its own file.
2022-11-21 16:46:19 +00:00
Ian Jackson
f087c7121d
bridge non-support: Move dummy bridge module into own file
...
A bit more stuff is going to appear here, so it's getting to be rather
much for an inline module.
2022-11-21 16:46:19 +00:00
Ian Jackson
7688973fd4
arti cfg test: Break out expect_err_contains function
...
Maybe this will want to be in tor-error or something but put it here
for now.
2022-11-21 16:46:19 +00:00
Ian Jackson
fa4f842340
bridge non-support: Disable the test for now
...
This test will start to fail if you compile without bridge support,
because we'll start rejecting the test configurations with bridges
specified.
We'll add a proper test for this later.
2022-11-21 16:46:19 +00:00
Ian Jackson
2c37116149
tor-config: introduce ConfigBuildError::Unsupported
...
And use it in bridge configuration parsing.
2022-11-21 15:46:53 +00:00
Ian Jackson
ac4869633a
tor-config: ConfigBuildError::within: Introduce add_prefix
2022-11-21 15:46:53 +00:00
Ian Jackson
681b4062ff
bridge config builder: Introduce error constructor helpers (fmt noise)
2022-11-21 15:46:53 +00:00
Ian Jackson
85d7651827
bridge config builder: Introduce error constructor helpers
...
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=12d13428d8fcc68b7b0f231bac9fc130b3eeb18b#d53209cbcd12771c549f3a130379ecb65dd60145_100_193
2022-11-21 15:46:53 +00:00
Ian Jackson
b0bd9b3fb3
bridge config builder: Document one id of each type restriction
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=620cc90f6dcdad20f49a001a9e04d191a323e904#d53209cbcd12771c549f3a130379ecb65dd60145_100_124
2022-11-21 14:58:24 +00:00
Ian Jackson
897d8a0ee3
bridge config builder: Document PT one address restriction
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/874/diffs?commit_id=620cc90f6dcdad20f49a001a9e04d191a323e904#d53209cbcd12771c549f3a130379ecb65dd60145_100_121
2022-11-21 14:58:24 +00:00
Ian Jackson
58710b9635
Make the bridge list in the builder be a list of BridgeConfigBuilder
...
By changing MultilineListBuilder.
2022-11-21 14:58:24 +00:00
Ian Jackson
9aa1c56fc9
BridgeConfigBuilder: Allow (de)ser to/from bridge lines
...
That the *de*serialisation works as expected will be tested properly
in just a moment, because when we plumb this all the way through, it
will be what parses the bridge lines in the example config file.
2022-11-21 14:58:24 +00:00
Ian Jackson
91536da10a
tor-basic-utils: Provide helper for serde flexible parsing
2022-11-21 14:58:24 +00:00
Ian Jackson
345d8e130b
BridgeConfigBuilder: Implement FromStr
2022-11-21 14:58:24 +00:00
Ian Jackson
cd2070b3ba
BridgeConfigBuilder: Introduce build() function
...
And test cases for it, and its errors.
2022-11-21 14:58:24 +00:00
Ian Jackson
589f74a78f
BridgeConfigBuilder: Introduce the struct with the dictionary repr
...
This struct is going to be the principal "dictionary-style" serde
representation for a bridge, and the builder, making this all in
keeping with our usual approach.
In this commit:
* Introduce the struct (defining the serialisation)
* Provide the setters (defining the Rust API)
* Add success test cases (not all of the data in which is used yet)
2022-11-21 14:58:24 +00:00
Ian Jackson
2327c7657c
tor-basic-utils: list_builder: Introduce DirectDefaultEmptyListBuilderAccessors
...
This trait can have this ludicrously long name because no-one needs to
import it.
2022-11-21 14:54:39 +00:00
Ian Jackson
88b60a1fa7
BridgeAddr rename: update tor_guardmgr::bridge::config
...
Here is where my motivation is and I'm working on this code now, so do
this renaming cleanup now.
2022-11-21 14:54:39 +00:00
Ian Jackson
fec66077de
BridgeAddr rename from PtTargetAddr: Update in tor-linkspec
...
And the error too.
We need this for the API for BridgeConfigBuilder, where the user can
specify any kind of target "address", even a hostname.
It's already non-conditional, it's just that the name is too limiting.
In this commit:
* Change in tor-linkspec
* Export transitional aliases
* Add TODOs to remove the transitional aliases
2022-11-21 14:54:39 +00:00
Ian Jackson
224f4905e4
tor-linkspec: Provide deconstructors for PtTargetSettings and PtTarget
2022-11-21 14:54:39 +00:00
Ian Jackson
0b14b93f76
arti-client, tor-config: Remove stability warning from top-level docs
...
Ticket #285 is closed and most of this is stable now we think.
(There are still a couple of stability warnings for specific types in
tor-config, which aren't exposed at the arti-client level.)
2022-11-21 12:06:27 +00:00
Ian Jackson
113341e397
cfg compilation: Add two allows
2022-11-18 18:50:00 +00:00
Ian Jackson
285a7988bb
Merge branch 'fix_nightly_20221118' into 'main'
...
Fix warnings and breakage in nightly (2022-11-18 edition)
See merge request tpo/core/arti!872
2022-11-18 16:43:16 +00:00
Ian Jackson
7ec52057dc
tor-guardmgr: Fix visibility of TestConfig with no features enabled
...
Without this, tor-guardmgr tests don't build when run without the
crate's own testing feature enabled.
2022-11-18 16:30:46 +00:00
Nick Mathewson
de9f3177b0
Fix a missing import in tests.
...
I'm not sure why the CI didn't reject this the first time around.
2022-11-18 10:34:19 -05:00
Nick Mathewson
47041bd4ce
Merge branch 'refactor_into_ownedchantarget' into 'main'
...
CircMgr: Refactor DirSpecificTarget constructor
See merge request tpo/core/arti!866
2022-11-18 15:21:46 +00:00
Nick Mathewson
829cb708e2
Fix a couple of rustdoc issues.
...
These slipped in while nightly was broken.
2022-11-18 10:19:54 -05:00
Nick Mathewson
d51162e55b
Fix a bunch of "needless borrow" warnings on nightly
...
It looks like, despite a few false starts, they've got this warning
right; there weren't any false positives.
2022-11-18 10:12:05 -05:00
Nick Mathewson
ec148a63cb
CircMgr: Refactor DirSpecificTarget constructor
...
This commit replaces the
`impl From<&T> for OwnedChanTarget where T:ChanTarget`
with a new `IntoOwnedChanTarget` trait. This lets us be explicit
that we're constructing an owned object, and not just converting
something.
No semver change needed, since these APIs haven't been released.
----------- (new description)
2022-11-18 09:55:46 -05:00
Nick Mathewson
c666133be4
Merge branch 'mark-bridges-not-experimental' into 'main'
...
Mark bridge and PT-related APIs as non-experimental.
Closes #643
See merge request tpo/core/arti!865
2022-11-18 14:22:31 +00:00
Nick Mathewson
76e41b8bf6
circmgr: make some imports conditional
...
This resolves an "unused import" warning when bridges are not
enabled.
2022-11-18 08:53:47 -05:00
Nick Mathewson
2c366927cc
arti-client: make bridge-client depend on dirmgr/bridge-client
...
This resolves some errors when building with `bridge-client` but not
with `--all-features`.
2022-11-18 08:53:47 -05:00
Nick Mathewson
b0e337d22d
arti: Mark bridge and pt support non-experimental, and on-by-default
2022-11-18 08:53:47 -05:00
Nick Mathewson
9229e1a59b
arti: Split long lines in Cargo.toml
...
This will make the next commit easier to review.
2022-11-18 08:53:47 -05:00
Nick Mathewson
f1f6005474
arti-client: Mark "bridge-client" and "pt-client" as non-experimental
2022-11-18 08:53:47 -05:00
Nick Mathewson
09591bcc5a
arti-client: split long lines in Cargo.toml
...
Doing this separately to make the next commit easier to read.
2022-11-18 08:53:47 -05:00
Nick Mathewson
9f661e264f
dirmgr: make "bridge-client" non-experimental.
2022-11-18 08:53:47 -05:00
Nick Mathewson
471cdc77f2
guardmgr: Make bridge-client and pt-client non-experimental
2022-11-18 08:53:47 -05:00
Nick Mathewson
1928fd0b72
circmgr: Make "specific-relay" non-experimental.
2022-11-18 08:53:47 -05:00
Nick Mathewson
b5a9e0b475
chanmgr: Make "pt-client" non-experimental.
2022-11-18 08:53:47 -05:00
Nick Mathewson
c441853cb8
Merge branch 'log_guard_status' into 'main'
...
GuardMgr: Log significant guard/bridge status changes at info/warn
Closes #627
See merge request tpo/core/arti!869
2022-11-18 13:51:42 +00:00
Ian Jackson
c0fa78fd4d
Merge branch 'display_chan_target' into 'main'
...
ChanTarget: Add a display function, with better output.
Closes #647
See merge request tpo/core/arti!868
2022-11-18 13:19:10 +00:00
Ian Jackson
fc047b4b3c
Merge branch 'inst_as_arg' into 'main'
...
GuardMgr: Resolve a `TODO pt-client` by having `update` take an `Instant`.
See merge request tpo/core/arti!863
2022-11-18 12:42:02 +00:00
Nick Mathewson
cb3a790084
netdoc: Add a test for routerdesc family parsing.
2022-11-17 14:40:15 -05:00
Nick Mathewson
5655b95b54
netdoc: Correct and test some tricky routerdesc errors
...
These required hex-editing identity certificates :P
2022-11-17 14:35:40 -05:00
Nick Mathewson
c0bc7bb11e
netdoc: Add tests for routerdesc accessors.
2022-11-17 13:43:32 -05:00
Nick Mathewson
9f53a79ddf
Netdoc: use a different desc in tests.
...
This is from Akka, which ahf runs.
2022-11-17 13:25:05 -05:00
Nick Mathewson
8dfbbca4e5
GuardMgr: Log when a guard status changes (significantly).
...
We previously had a trace message on _every_ change. That's fine,
but we also want to log more important changes where the user
can see them. Namely:
* If we go from any other status to Reachable, we want to tell
the user. (We don't want to spam them if it was already
reachable.)
* If we go from Untried or Reachable to Unreachable, we want to
tell the user. (We don't tell them about changes from Retriable
to Unreachable, since that just means that a retry attempt
was not successful.)
Closes #627 .
2022-11-17 12:32:57 -05:00
Nick Mathewson
6c5dd05698
GuardMgr: split Reachable::Unknown into Untried and Retriable
...
There are two cases here, and we will want to log them
differently.
(By removing the "Unknown" variant entirely, we ensure that we
didn't miss any code that formerly checked for Unknown.)
2022-11-17 12:21:06 -05:00
Nick Mathewson
effd53510d
ChanMgr: Log every conection attempt at debug.
2022-11-17 12:01:57 -05:00
Nick Mathewson
95081198e5
Remove impl Display for OwnedCircTarget
...
Nothing used this; if anything wants it, it would be better off
calling `.display_chan_target()`.
2022-11-17 09:12:57 -05:00
Nick Mathewson
25702ccd9e
ChanTarget: Add a display function, with better output.
...
This change lets us display a ChanTarget's members without first
cloning them into an OwnedChanTarget.
It also resolves a reliability issue by outputting better info when
talking about connections via pluggable transports.
Closes #647
2022-11-17 09:06:08 -05:00
Nick Mathewson
cf152c5ed6
linkspec: Make "pt-client" non-experimental.
2022-11-16 12:26:31 -05:00
Nick Mathewson
7d4691e402
chanmgr: rename new_test_channel_map to new_test_state.
2022-11-16 12:07:47 -05:00
Nick Mathewson
b466e24235
chanmgr::mgr::*: misc spelling fixes and normali[sz]ations
2022-11-16 12:05:20 -05:00
Nick Mathewson
53c401af65
Fix up documentation that referred to a ChannelMap.
2022-11-16 12:02:02 -05:00
Nick Mathewson
5804f0f350
ChanMgr: Rename map.rs to state.rs
...
This is another pure renaming.
2022-11-16 11:46:11 -05:00
Nick Mathewson
8271037d37
ChanMgr: Rename ChannelMap to MgrState
...
We're doing this because the type now holds "all the mutable state
in a ChanMgr", not just the map.
This is a pure renaming; no documentation has been updated.
Part of #606 .
2022-11-16 11:32:49 -05:00
Nick Mathewson
76a89fb178
GuardMgr: Add Instant to update().
...
This lets us avoid calling `Instant::now()`, when `Runtime::now()`
is what we want.
Unfortunately, there are a bunch of functions that called `update()`
that needed to change. Fortunately, none of the changes were very
complicated.
Fixes a `TODO pt-client` comment.
2022-11-16 09:56:51 -05:00
Nick Mathewson
fd2253cd44
GuardMgr: Rename "now" arg in update() to "wallclock"
...
I'm about to add an `Instant` argument. By convention, when we have
both, we call the Instant "now".
This commit is a pure renaming.
2022-11-16 09:40:25 -05:00
Nick Mathewson
4a1b3d8954
guardmgr: Remove a now-unneeded "allow(dead_code)"
2022-11-16 09:22:23 -05:00
eta
09b918515c
Merge branch 'ptmgr-config' into 'main'
...
tor-ptmgr: make configuration use builders, plumb into arti-client
See merge request tpo/core/arti!823
2022-11-16 12:12:35 +00:00
Ian Jackson
b46d1600e7
Merge branch 'real_netdoc_pos' into 'main'
...
Replace `Option<Pos>` with `Pos` in `ParseError`.
Closes #640
See merge request tpo/core/arti!859
2022-11-16 11:50:20 +00:00
Ian Jackson
d7dc02968f
pt config, arti cfg test: Expect bridges.transports to be missing
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/823#note_2854365
2022-11-16 11:39:25 +00:00
Ian Jackson
4fe5e8fcaa
arti cfg test: Coalesce expect_missing
...
If there are subkeys which are covered by also expected_missing
superkeys, delete them, since we expect the superkey to be missing, so
the subkey won't show up.
2022-11-16 11:39:25 +00:00
eta
1c9f6fb179
tor-ptmgr: make configuration use builders, plumb into arti-client
...
This brings the draft configuration mechanisms in tor-ptmgr in line with
the config in other crates, using builders. It also plumbs the config
type through into the main `arti-client` config, and adds some example
lines to `arti-example-config.toml`.
2022-11-16 11:39:25 +00:00
Nick Mathewson
7a42cb0e45
Remove a `TODO pt-client` in netdoc.
...
This issue is now torspec!94.
2022-11-15 17:19:26 -05:00
Nick Mathewson
39615516fd
Replace `Option<Pos>` with `Pos` in `ParseError`.
...
We already have `Pos::Unknown` for an error at an unknown
location and `Pos::None` for an error where no location is
sensible. There's no reason to have an additional `Option` here.
Additionally, the use of `Option` gave us a bug where our old
`ParseError::at_pos()` method didn't actually set the position
unless the position was already set. That's not what we want!
Fixes #640 .
Finally, we have to fix a test that was a bit broken because it was
working around #640 .
2022-11-15 16:58:23 -05:00
Nick Mathewson
0378a14014
Merge branch 'fix_bridgeconf_lookup' into 'main'
...
Allow a subset-only ChanMethod match when looking up a BridgeConfig
Closes #642
See merge request tpo/core/arti!858
2022-11-15 19:18:51 +00:00
Ian Jackson
86c7a2da7f
Merge branch 'cfg-doc' into 'main'
...
arti cfg test: Add more documentation
See merge request tpo/core/arti!856
2022-11-15 19:05:12 +00:00
Nick Mathewson
2bd422663e
Resolve a dead-code warning.
2022-11-15 13:53:14 -05:00
Nick Mathewson
d78cde7dea
Allow a subset-only ChanMethod match when looking up a BridgeConfig
...
If we have a bridge guard that is using Direct connection and it
knows multiple addresses, our code to match it with a BridgeConfig
is wrong, because the BridgeConfig has only one address, and our
code looks for an exact match.
Fixes #642 .
2022-11-15 13:53:14 -05:00
Ian Jackson
67242a2986
arti cfg test: Document exhaustive_1 and comment exhaustive
2022-11-15 18:25:39 +00:00
Nick Mathewson
db9440464b
Remove a spurious log that I committed by mistake. Whoops.
2022-11-15 13:15:32 -05:00
eta
5eccaf008b
Merge branch 'fix_parse' into 'main'
...
netdoc: Allow empty lines at the end of router descriptors
Closes #637
See merge request tpo/core/arti!857
2022-11-15 17:41:29 +00:00