Commit Graph

2752 Commits

Author SHA1 Message Date
70cc19bf67 nixpkgs -> latest 2024-06-26 12:00:35 +00:00
67649863fa recursor_test: backfill a test for CNAMEs which point to nonexistent records 2024-05-10 05:15:52 +00:00
338b35bc25 recursor_test: backfill a test which ensures the resolver is resilient to infinite cycles 2024-05-10 05:00:22 +00:00
6e251e348d recursor_test: backfill a test which follows CNAMEs through more than one layer 2024-05-10 04:51:58 +00:00
c669e3d397 recursor_test: backfill a test which follows CNAMEs across NS 2024-05-10 04:46:26 +00:00
999cdf4950 recursor_test: backfill a test which follows CNAMEs across zones 2024-05-10 04:33:31 +00:00
fd265a9ae4 recursor: fix to resolve most CNAMEs 2024-05-10 04:04:59 +00:00
c43bef87f9 recursor_test: backfill a CNAME test
there are more cname tests to add, but they would fail without code change :)
2024-05-09 06:59:54 +00:00
2aa98d0799 recursor_test: port to Catalog, and enable full recurse test
the SOA logic requires iana-servers and example.com to properly be in two separate zones, hence a Catalog
2024-05-08 08:33:28 +00:00
50e0653373 recursor_test: implement test_v4_domain 2024-05-08 01:01:56 +00:00
d95b4202b2 recursor_test: implement test_tld_txt text 2024-05-07 22:19:04 +00:00
9c6b064dba recursor_test: add a minimal recursor test 2024-05-07 22:09:14 +00:00
80f2a17bff recursor: make the test helpers more capable
they did not previously allow any way to mock DNS query sequences
in a manner compatible with the RecursorPool, which prefers to create
new NameServers itself, rather than via anything injectable by the test.
2024-05-05 20:07:46 +00:00
ec4e22817a recursor: define the bare minimum integration test 2024-04-29 19:39:47 +00:00
591a4a9fb2 reintroduce the recursor integration test
it was deleted during some cleanup work in 10d2ffcb04.
2024-04-29 14:36:08 +00:00
f6b7fc1287 svcb: fix build error
when running tests:
```
error[E0277]: the trait bound `Vec<u8>: From<&[u8; 5]>` is not satisfied
```
2024-04-29 14:33:56 +00:00
6e4af5c549 flake: init 2024-04-29 13:25:19 +00:00
Benjamin Fry
6334a01430 update rustls 0.21.11 to fix audit 2024-04-20 23:20:44 +02:00
situ2001
cad6eed6b4 fix: update ip of example.com 2024-04-20 13:08:29 -07:00
situ2001
eb79382a36 fix: update ip of example.com 2024-04-20 13:08:29 -07:00
Benjamin Fry
76a4b84216 fix 0.24.1 Changelog entry 2024-04-18 13:32:26 -07:00
Dirkjan Ochtman
5d2098b27f Bump version to 0.24.1 2024-04-18 13:32:26 -07:00
Benjamin Fry
cf46fd476d add 0.24.1 release note 2024-04-18 13:32:26 -07:00
Daniel McCarney
0b70253e86 rdata_parsers: fix handling of escaped list delim
The RFC 9460 presentation syntax allows escaping the ',' list separator
in a `SvcParamValue` by writing `\,`. This commit updates `parse_list`
to handle this case.

Once this is done, one of the RFC 9460 test vectors using this feature
can be added to the unit tests. We don't yet support the more
complicated escaped comma using an escaped backslash for delimiter
escape so one remaining test vector for this is left out.
2024-04-18 11:57:53 +02:00
Daniel McCarney
2a91cdb066 proto: fix parse of arbitrary keys in pres. syntax
Previously the `FromStr` impl for `SvcParamKey` had support for parsing
the "arbitrary key" presentation syntax where a key can be specified
"keyNNNNN", where NNNNN is the numeric value of the key type without
leading zeros. The existing code would pull out the numeric component
into a `u16` and then use the `TryFrom<u16>` impl for `SvcParamKey` to
get the key.

However, the `TryFrom<u16>` impl for `SvcParamKey` was using the IANA
service parameter keys registry to map from u16s to `SvcParamKey`.
Values 0..6 are mapped to the known key entries. The reserved range
(65280-65534) was mapped to `SvcParamKey::Key`, and 65535 was mapped to
`SvcParamKey::Key65535`. This makes sense when mapping an arbitrary u16,
but when we are parsing a "keyNNNNN" presentation syntax item, we want
to represent it as `Key(NNNNN)`, no matter if it is/isn't a registered
key.

This commit fixes this behaviour, constructing a `SvcParamKey::Key()`
entry when parsing the arbitrary key presentation syntax, avoiding
`TryFrom<u16>`.

With this change in place the two arbitrary key test vectors can be
included in the svcb test vector unit test.

[0] https://datatracker.ietf.org/doc/html/rfc9460#name-initial-contents
2024-04-18 11:57:53 +02:00
Daniel McCarney
2913b659e3 rdata_parsers: add RFC 9460 test vectors
See https://datatracker.ietf.org/doc/html/rfc9460#appendix-D

Tests that we can parse the presentation format for each of the positive
test vectors.

Possible follow-up work:
  * Add the negative failure tests
  * Add coverage for wire format matching expected
2024-04-18 11:57:53 +02:00
Daniel McCarney
ccfdb8479d rdata_parsers: support quoted SVCB parameter values
The presentation format for RFC9460 SVCB/HTTPS RR types allows for
parameter values to be quoted. The code for processing parameter values
in hickory-dns had a comment indicating quotes should have been
stripped, but this wasn't occurring in practice.

This commit updates the parsing logic to perform the mentioned quote
stripping, and updates the unit tests with fresh data found from doing
`HTTPS` lookups for `google.com` and `crypto.cloudflare.com`. Notably
both of these show quoted strings in `dig`'s presentation format output
and so were sufficient to tickle the bug fixed above.
2024-04-18 11:57:53 +02:00
Daniel McCarney
5e23b5e587 rdata: store wire-encoded form of ECH configs
Previously the hickory-dns representation of ECH configs found in
SVCB/HTTPS records held and exposed its own non-standard representation
of the encoded ECH configs. Notably, it stripped the TLS-encoded list
length prefix from the remaining data. Similarly, it's presentation
format was the BASE64 encoding of this non-standard form.

Downstream consumers are likely to want the wire-encoding format
unmodified, because ECH is of most use to TLS libraries where they will
have already implemented a generic TLS-encoded list decoder that expects
the length prefix. In practice, popular tools like `dig`
are also encoding the presentation format BASE64 of the data in DNS for
some popular test servers with the prefix included.

This commit updates hickory-dns's representation to not do the
pre-processing it was before. This is trivial for a consumer to do if
they need it, and avoids having to restore it manually in order to use
other pre-existing TLS encoder/decoders with the value from hickory-dns.

Again, since ECH adoption is in very early days it doesn't seem
worthwhile to try and come up with a backwards compatible interface for
those that need the old behaviour. It should be straightforward to
remove the length prefix manually if required.
2024-04-18 11:57:53 +02:00
Daniel McCarney
ffc51d7369 proto: rename ECH SVCB types
Previously the hickory-dns representation for ECH configurations in
SVCB/HTTPS records were named `EchConfig` and stored/exposed
a non-standard encoding of the config data, with the TLS-encoded length
prefix stripped.

In practice (and perhaps made clearer by draft-ietf-tls-svcb-ech-01[0]
vs earlier texts), the value in wire-encoded form is "an ECHConfigList"
as specified in Section 4 of draft-ietf-tls-esni-18[1] in TLS
presentation language as:

```
ECHConfig ECHConfigList<1..2^16-1>;
```

To make it clearer that it's a _list_ of `ECHConfig` values in the
`ech=` SVCB/HTTPS key, this commit renames the types to emphasize their
listy-ness.

[0]: https://datatracker.ietf.org/doc/html/draft-ietf-tls-svcb-ech-01
[1]: https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-18#section-4
2024-04-18 11:57:53 +02:00
Daniel McCarney
c96e717871 rdata_parsers: reorder svcb parse helpers
Prev the ECH config parsing was placed in between parsing ipv4 and ipv6
hints. This commit reorders so that `parse_ech_config()` is after
`parse_ipv4_hint()` and `parse_ipv6_hint()`.
2024-04-18 11:57:53 +02:00
Daniel McCarney
8f29bb032d proto: correct ECH service parameter key
Previously `"echconfig"` was being used as the encrypted client hello
(ECH) service parameter key for SVCB/HTTPS RRs.

In RFC960 the parameter key is specified in the intial IANA registry
contents as `"ech"`[0].

This commit updates the two relevant parts of hickory (and corresponding
test data) to use the up-to-date parameter key.

This is a breaking change, however given the very low adoption of ECH,
and the use of the correct `"ech"` key in popular test servers, it
doesn't seem worth trying to maintain backwards compatibility with
earlier draft RFC values.

[0]: https://datatracker.ietf.org/doc/html/rfc9460#section-14.3.2
2024-04-18 11:57:53 +02:00
Daniel McCarney
190c814eb3 svcb: update docs to ref RFC 9460
Since initial support for SVCB/HTTPS RRs landed in hickory-dns, RFC
9460[0] was published:

  Service Binding and Parameter Specification via the DNS (SVCB and HTTPS
  Resource Records)

This is the definitive reference for SVCB and HTTPS RRs and previous
references to `draft-ietf-dnsop-svcb-https-XX` need to be updated.

Thankfully, it seems as though the implementation did not change
meaningfully from draft-03 and so this commit can largely just update
documentation references and copied quotations to match RFC 9460.

One minor change is worth mentioning: the Encrypted Client Hello (ECH)
aspects of the draft were removed pre-publication and the RFC9460 IANA
registry includes a "reserved" allocation for the `"ech"` key, but no
details on its use. These details are now located in a separate draft,
draft-ietf-tls-svcb-ech-01[1].

Since the code in `svcb.rs` also concerned itself with ECH it now
references draft-ietf-tls-svcb-ech-01 where the ECH specific usage of
service parameter is under specification. Notably the new draft and RFC
9460 both use `"ech"` for the service parameter key for encrypted client
hello configs. Hickory-dns is currently using `"echconfig"`, but this
will be fixed in a follow-up commit to keep this one documentation only.

[0]: https://datatracker.ietf.org/doc/html/rfc9460
[1]: draft-ietf-tls-svcb-ech-01
2024-04-18 11:57:53 +02:00
Daniel McCarney
c01db51555 ci: offer a branch push pattern for easy testing
Pushing branches named "$WHATEVER_dev" will result in CI being run. This
is helpful for those working on a fork that want a quick way to test CI
for their branch before opening a PR.
2024-04-18 11:57:53 +02:00
Benjamin Fry
94ac564c3f ignore portions of the README in Oranda site generation 2024-04-14 11:30:50 +02:00
Daniel McCarney
5aeb1d0209 resolver: err for dns-over-rustls w/o roots
If we find that we've constructed a Rustls root cert store that has no
trust anchors, return an early error. This makes the problem obvious
and avoids surfacing some other less specific error cause when we first
try to validate a peer certificate with an empty root store.

In order for our new early error to be surfaced correctly the
`name_sever_pool.rs` `parallel_conn_loop` fn needs its error handling
adjusted. Previously it would always compare the new error produced by
trying to build the TLS config against the default error it starts its
loop with, `ProtoErrorKind::NoConnections`. Since the error being
returned is another `ProtoErrorKind`, and the error specificity
comparison considers two `ProtoErrorKinds` equivalent in the general
case, the default error was always returned and the new error thrown
away.
2024-04-14 07:33:30 +02:00
Daniel McCarney
2e84c1184b error: wrap io::Error in Arc for clone
`ProtoErrorKind` is `Clone`, but the `Io` variant holding `io:Error`
runs into trouble with this: since the error can't be cloned we have to
reconstruct it and this is a lossy process: resulting in a "simple"
`io::Error` that only holds the error type from the parent it was cloned
from. This loses important details like the underlying error
source/message.

This commit changes `ProtoErrorKind::Io` to hold `Arc<io::Error>>`
instead. This makes implementing `Clone` trivial - we clone the arc
- and no error information is lost.
2024-04-14 07:30:55 +02:00
0xffffharry
6c2a1e2c23 Make QuicClientStream Clonable 2024-04-10 09:42:39 +02:00
Dirkjan Ochtman
f1ced8a958 Update semver-compatible dependencies 2024-04-09 21:43:08 -04:00
Dirkjan Ochtman
70be0c5aa0 Upgrade rusqlite to 0.31 2024-03-22 08:33:27 -04:00
Dirkjan Ochtman
b7ce4cc292 Upgrade prefix-trie to 0.3 2024-03-22 08:33:27 -04:00
Dirkjan Ochtman
fced74e477 Update semver-compatible dependencies 2024-03-22 08:33:27 -04:00
Dirkjan Ochtman
4ebc33f2f1 Apply clippy suggestions from Rust 1.77 2024-03-22 08:33:27 -04:00
dependabot[bot]
9e8f8c67fb Bump http from 1.0.0 to 1.1.0
Bumps [http](https://github.com/hyperium/http) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/hyperium/http/releases)
- [Changelog](https://github.com/hyperium/http/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/http/compare/v1.0.0...v1.1.0)

---
updated-dependencies:
- dependency-name: http
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 14:36:15 -04:00
dependabot[bot]
e9d7075ed4 Bump extractions/setup-just from 1 to 2
Bumps [extractions/setup-just](https://github.com/extractions/setup-just) from 1 to 2.
- [Release notes](https://github.com/extractions/setup-just/releases)
- [Commits](https://github.com/extractions/setup-just/compare/v1...v2)

---
updated-dependencies:
- dependency-name: extractions/setup-just
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 13:45:38 -04:00
David Lönnhager
d2e64d8d26 Break when socket is unexpectedly shut down 2024-03-16 13:21:54 -04:00
Marcus Butler
da41e4ad06 Update mio to 0.8.11 to fix RUSTSEC-2024-0019 2024-03-04 23:03:01 +01:00
Marcus Butler
3db11773cd Fix formatting issue in crates/proto/src/op/message.rs 2024-03-04 23:02:24 +01:00
Hoe Hao Cheng
f382e96a90 Forward hickory-dns's root cert features to hickory-resolver 2024-03-04 14:39:29 +01:00
situ2001
966bc27c6e fix: not returning the result of a let binding from a block 2024-03-02 13:03:23 -05:00
situ2001
92ff81ca29 test: Header count setting 2024-03-02 13:03:23 -05:00