Commit Graph

4504 Commits

Author SHA1 Message Date
Jim Newsome cef9a7b65a Create a shadow-based integration test
Fixes https://gitlab.torproject.org/tpo/core/arti/-/issues/174
2022-10-05 12:48:45 -05:00
Nick Mathewson 068b4d944e Merge branch 'dont-limit-coredump' into 'main'
remove manual limitation of coredump size

Closes #598

See merge request tpo/core/arti!757
2022-10-05 16:54:47 +00:00
trinity-1686a f230cb5c03 remove manual limitation of coredump size
it's already disabled by secmem_proc
2022-10-05 18:32:16 +02:00
Nick Mathewson 4fd98c1760 Merge branch 'no-default-feature-arti-client' into 'main'
feature-gate some functions requiring PreferredRuntime in arti_client

Closes #597

See merge request tpo/core/arti!756
2022-10-05 12:51:27 +00:00
trinity-1686a 2b8b775dfc feature-gate some functions requiring PreferredRuntime 2022-10-05 12:54:04 +02:00
Nick Mathewson 0f06b9af0b Merge branch 'by_relay_id_set' into 'main'
Implement ByRelayIds<H : HasRelayIds>

See merge request tpo/core/arti!753
2022-10-04 20:34:49 +00:00
Nick Mathewson d50efc835b Bump to new arti-corpora. 2022-10-04 16:17:45 -04:00
Nick Mathewson 5a5f96aa37 n_key_set: Fix bugs in API documentation.
For whatever reason, rustdoc didn't like these multiline strings
in `doc` attributes.
2022-10-04 16:05:40 -04:00
Nick Mathewson 11caa46525 tor-linkspec: ByRelayIds<> type to hold a set of HasRelayIds
This is based on the type generated with n_key_set, with a
couple of extra methods to take advantage of RelayId and RelayIdRef.
2022-10-04 16:05:40 -04:00
Nick Mathewson f8382d4978 n_key_set: Wrap "where" clauses in square brackets too.
Otherwise, there is a parsing ambiguity. :(
2022-10-04 16:05:40 -04:00
Nick Mathewson 8475d3ab39 n_key_set: Rename generic parameters on functions.
Previously we used `<T>` in a bunch of places.  But that fails
if you try to declare `T` as a parameter on the structure itself.
2022-10-04 16:05:40 -04:00
Nick Mathewson bf7c0bb2ba n_key_set: Add a try_insert().
I am finding as I use this that I want a variant that can't panic.
2022-10-04 16:05:40 -04:00
Ian Jackson 9705ef3fea Merge branch 'bridge-parse' into 'main'
Parse (and format) bridge lines

See merge request tpo/core/arti!745
2022-10-03 20:13:02 +00:00
Ian Jackson 193d0f7007 pt: bridge line parsing: overhaul errors
Include the offending word in all the applicable errors.
Always print it with {word:?}.

As a consequence, there are no From impls any more and error
generation/conversion is by hand in all cases.

Clarify InvalidPtOrAddr vs InvalidIAddrorPt, and don't make the
attempted parse be a source error for those.

Where we still have source errors, don't print them in Display.
2022-10-03 20:45:54 +01:00
Ian Jackson c920dca9b2 pt: transport ID error: Fix style to remove full stop 2022-10-03 20:45:54 +01:00
Ian Jackson 00fb96650b pt: Check PT key=value syntax
This is not perfect but it at least ensures that our own parsing and
printing code works correctly with all the values we accept.
2022-10-03 20:45:54 +01:00
Ian Jackson b67b5ac536 pt: Make PtTarget::push_setting fallible, and take Into
It has its own error type PtTargetInvalidSetting.

In check_doc_features, adjust suppression to new code.
2022-10-03 20:45:54 +01:00
Ian Jackson a237b80ad8 pt: bridge line parsing: Add commentary 2022-10-03 20:45:54 +01:00
Ian Jackson f6a6fe0d8e pt: Document Bridge line syntax 2022-10-03 20:45:54 +01:00
Ian Jackson 01222dd9e7 pt: PtTransportAddr: change None string to "-"
This is going to appear in config files etc.  We don't want the user
to have to type "<none>" in a bridge line.
2022-10-03 20:45:54 +01:00
Nick Mathewson b08ac01b61 Merge branch 'new-libfuzzer' into 'main'
Upgrade all fuzzers to newer libfuzzer-sys version.

See merge request tpo/core/arti!752
2022-10-03 19:13:09 +00:00
Nick Mathewson 0d985b0def Merge branch 'hostname-validation' into 'main'
Use hostname-validator crate for hostname validation

See merge request tpo/core/arti!739
2022-10-03 19:01:56 +00:00
Nick Mathewson 128fb76c73 Upgrade all fuzzers to newer libfuzzer-sys version. 2022-10-03 14:35:34 -04:00
Nick Mathewson 88a06225b9 Remove semver.md files now that arti 1.0.1 is out. 2022-10-03 14:16:56 -04:00
Nick Mathewson 7402578af4 Merge branch 'multi_keyed_set' into 'main'
Include a HashSet variant that can be keyed on multiple keys.

See merge request tpo/core/arti!747
2022-10-03 18:16:10 +00:00
Nick Mathewson 1329f2c8f3 n_key_set: fix doctest compilation. 2022-10-03 13:31:03 -04:00
Nick Mathewson 8ab2a88923 n_key_set: Update generic syntax
Doing this lets us work with defaults and const generics.
2022-10-03 13:31:01 -04:00
Nick Mathewson 857272bc7a n_key_set: rename map elements.
This prevents an explosion if somebody has a key called "values".
2022-10-03 13:31:01 -04:00
Nick Mathewson 9c08fdb865 n_key_set: Add support for generic lifetimes.
It doesn't work for const generics yet, since they can't be repeated
in quite the same way.
2022-10-03 13:31:01 -04:00
Nick Mathewson 48a15d5627 Tweaks and improvements in documentation.
Most of these were suggested by Ian
2022-10-03 13:31:01 -04:00
Nick Mathewson 4724639d7c Require slab 0.4.4
The `try_remove()` method, which we need, was introduced there.
2022-10-03 13:31:01 -04:00
Nick Mathewson 59f1f7c11d Repair rustdoc.
The previous indentation was making it think that we had rust code
where none existed.
2022-10-03 13:31:01 -04:00
Nick Mathewson 9fd072a4d4 n_key_set: Add a function to check invariant violations
Also, document another invariant.
2022-10-03 13:31:01 -04:00
Nick Mathewson 0dc1573268 n_key_set: Use remove_by_foo to implement insert. 2022-10-03 13:31:01 -04:00
Nick Mathewson e06ae79009 n_key_set: Panic on more invariant and constraint violations. 2022-10-03 13:31:01 -04:00
Nick Mathewson 43fd594819 n_key_set: Remove by_$key_mut.
This can't be used in a consistency-preserving way.
2022-10-03 13:31:01 -04:00
Nick Mathewson 7043df0241 n_key_set: Add flags to keys rather than inferring from Option<T>
Using Option<T> as an alias for T was too clever indeed, and it
meant that our HashMaps were declared with the wrong types.

Putting flags here instead gives us an extension point that we can
use in the future.
2022-10-03 13:31:01 -04:00
Nick Mathewson f0d74db38e n_key_set: Use to_owned to permit &str accessors. 2022-10-03 13:31:01 -04:00
Nick Mathewson 47c9ae0e4b n_key_set: Add some tests, and notes on infelicities. 2022-10-03 13:31:01 -04:00
Nick Mathewson 4e3a390c5b n_key_set: Fix a bug in function access. 2022-10-03 13:31:01 -04:00
Nick Mathewson 0321912ad0 n_key_set: add FromIterator. 2022-10-03 13:30:54 -04:00
Nick Mathewson c2d4b4ed3b Include a HashSet variant that can be keyed on multiple keys.
Every element in the set has up to N keys, each of which may have differnt
types.  No value for any key may correspond to more than one element in
the set.

These properties can be provided, via a macro, for values of N between 1
and $BIG_ENOUGH.

We'll use this to implement a type that holds HasRelayIds.
2022-10-03 13:30:37 -04:00
Nick Mathewson 05868fea7f Merge branch 'socks_client' into 'main'
Implement a SOCKS client handshake

See merge request tpo/core/arti!746
2022-10-03 17:23:24 +00:00
Nick Mathewson f81afe4930 Move generate_* methods in socks client impl. 2022-10-03 12:52:38 -04:00
Nick Mathewson f663f5fdd2 Require no NUL in socks hostname. 2022-10-03 12:52:38 -04:00
Nick Mathewson 41be40694d Tweak "handshake" docs.
Per a suggestion from Diziet, clarify that the socks handshake code
only wants you to drain your buffers when it tells you to.
2022-10-03 12:52:38 -04:00
Nick Mathewson 235bda1210 Add a SocksReply type to capture address/port information.
I don't expect us to need this information much, but we may as well
hang on to it.
2022-10-03 12:52:38 -04:00
Nick Mathewson f12202d707 Make sure that socks4 auth doesn't have any 0 bytes.
Try to do it in constant time, to avoid even the smell of
side-channel attacks.
2022-10-03 12:52:38 -04:00
Nick Mathewson 3ae062911b Tests for socks client handshake.
These tests include a few reference cases, as well as a little
framework to make sure that the client and the proxy implementation
will handshake with one another successfully.
2022-10-03 12:52:38 -04:00
Nick Mathewson cb4e32ddc7 Bug fix: report empty SOCKS4 auth as "no auth".
Previously we would report it as authenticating using the empty
string.
2022-10-03 12:52:38 -04:00