Commit Graph
910 Commits
Author SHA1 Message Date
Ava ChowandGitHub 053dbc16df Remove incorrect compose_len from rrsig (#313)
ProtoRrsig is used to produce the data that is signed. According to
RFC 4034, this serialization begins with the first rdata field which is
type_covered, however ProtoRrsig is inserting a length at the beginning. As
such, signatures produced by SortedRecords::sign() are invalid. Fix this by
removing that length from the serialization.
2024-05-10 10:52:18 +02:00
Martin Hoffmann e302148f4f Update changelog. 2024-05-06 15:28:26 +02:00
Ximon EighteenandGitHub bbfd6ff6ec More Dname to Name renaming. (#308) 2024-05-06 15:26:00 +02:00
Martin Hoffmann 11f5f7c04c Another try vis-a-vis the mock_instant feature. 2024-05-06 14:07:10 +02:00
Martin Hoffmann 1019300147 Another try vis-a-vis the mock_instant feature. 2024-05-06 13:59:22 +02:00
Martin Hoffmann febbda7e08 Update changelog. 2024-05-06 13:52:42 +02:00
Martin Hoffmann 6d8352c8b8 Merge branch 'main' of github.com:NLnetLabs/domain 2024-05-06 13:52:07 +02:00
Martin Hoffmann 665b3cfb85 Clippy-suggested improvements. 2024-05-06 13:51:57 +02:00
Martin Hoffmann d48a15b0ed Comment out remnantts of mock_instant feature. 2024-05-06 13:47:52 +02:00
xofyargandGitHub 2a13facac4 Minor fixes for 0.10.0 (#310)
This PR contains the following fixes:

* Allow AllRecordData’s parsing impls to accept an unsized [u8] as the
  source octets.
* Accept an empty record type bitmap when scanning NSEC/NSEC3 data.
2024-05-06 13:41:18 +02:00
Ava ChowandGitHub ffcb975523 Make FamilyName::new() public (#312) 2024-05-06 13:35:40 +02:00
Martin Hoffmann c05b1404fe Bump version. 2024-04-30 12:49:28 +02:00
Martin HoffmannandGitHub 524a3108a6 Release 0.10.0. (#306)
Breaking changes

* All types and functions referring to domain names have been changed from
  using the term “dname” to just “name.” For instance, `Dname` has become
  `Name`, `ToDname` has become `ToName`, and `ToDname::to_dname` has become
  `ToName::to_name`. ([#290])
* The `ToName` and `ToRelativeName` traits have been changed to have a
  pair of methods a la `try_to_name` and `to_name` for octets builders
  with limited and unlimited buffers, reflecting the pattern used
  elsewhere. ([#285])
* The types for IANA-registered parameters in `base::iana` have been
  changed from enums to a newtypes around their underlying integer type
  and associated constants for the registered values. (This was really
  always the better way to structure this.) ([#276], [#298])
* The `Txt` record data type now rejects empty record data as invalid. As
  a consequence `TxtBuilder` converts an empty builder into TXT record
  data consisting of one empty character string which requires
  `TxtBuilder::finish` to be able to return an error. ([#267])
* `Txt` record data serialization has been redesigned. It now serialized as
  a sequence of character strings. It also deserializes from such a sequence.
  If supported by the format, it alternatively deserializes from a string that
  is broken up into 255 octet chunks if necessary. ([#268])
* The text formatting for `CharStr` has been redesigned. The `Display`
  impl now uses a modified version of the representation format that
  doesn’t escape white space but also doesn’t enclose the string in
  quotes. Methods for explicitly formatting in quoted and unquoted
  presentation format are provided. ([#270])
* The `validate::RrsigExt` trait now accepts anything that impls
  `AsRef<Record<..>>` to allow the use of smart pointers. ([#288] by
  [@hunts])
* The stub resolver now uses the new client transports. This doesn’t change
  how it is used but does change how it queries the configured servers.
  ([#215])
* The sub resolver’s server configuration `Transport` type has been
  changed to be either `Transport::UdpTcp` for trying UDP and if that
  leads to a truncated answer try TCP and `Transport::Tcp` for only trying
  TCP. The stub resolver uses these accordingly now ([#296])
* Many error types have been changed from enums to structs that hide
  internal error details. Enums have been kept for errors where
  distinguishing variants might be meaningful for dealing with the error.
  ([#277])
* Renamed `Dnskey::is_zsk` to `is_zone_key`. ([#292])
* Split RRSIG timestamp handling from `Serial` into a new type
  `rdata::dnssec::Timestamp`. ([#294])
* Upgraded `octseq` to 0.5. ([#257])
* The minimum Rust version is now 1.70. ([#304])

New

* Add impls for `AsRef<RelativeDname<[u8]>>` and `Borrow<RelativeDname<[u8]>>`
  to `RelativeDname<_>`. ([#251] by [@torin-carey])
* Added `name::Chain::fmt_with_dots` to format an absolute chained name
  with a final dot. ([#253])
* Added a new `ParseAnyRecordData` trait for record data types that can
  parse any type of record data. ([#256])
* Added implementations of `OctetsFrom` and `Debug` to `AllOptData` and
  the specific options types that didn’t have them yet. ([#257])
* Added missing ordering impls to `ZoneRecordData`, `AllRecordData`,
  `Opt`, and `SvcbRdata`. ([#293])
* Added `Name::reverse_from_addr` that creates a domain name for the
  reverse lookup of an IP address. ([#289])
* Added `OptBuilder::clone_from` to replace the OPT record with the
  content of another OPT record. ([#299])
* Added `Message::for_slice_ref` that returns a `Message<&[u8]>`. ([#300])

Bug fixes

* Fixed the display implementation of `name::Chain<_, _>`. ([#253])
* Fixed the display implementation of `rdata::Txt<..>`. It now displays
  each embedded character string separately in quoted form. ([#259])
* Fixed the extended part returned by `OptRcode::to_parts` (it was shifted
  by 4 bits too many) and return all 12 bits for the `Int` variant in
  `OptRcode::to_int`. ([#258])
* Fixed a bug in the `inplace` zonefile parser that made it reject
  character string of length 255. ([#284])

Unstable features

* Added the module `net::client` with experimental support for client
  message transport, i.e., sending of requests and receiving responses
  as well as caching of responses.
  This is gated by the `unstable-client-transport` feature. ([#215],[#275])
* Added the module `net::server` with experimental support for server
  transports, processing requests through a middleware chain and a service
  trait.
  This is gated by the `unstable-server-transport` feature. ([#274])
* Added the module `zonetree` providing basic traits representing a
  collection of zones and their data. The `zonetree::in_memory` module 
  provides an in-memory implementation. The `zonetree::parsed` module
  provides a way to classify RRsets before inserting them into a tree.
  This is gated by the `unstable-zonetree` feature. ([#286])
v0.10.0
2024-04-30 12:45:29 +02:00
Martin HoffmannandGitHub bf163e1bd0 Make net not include tokio-rustls. (#305)
This PR removes tokio-rustls as a dependency of the net feature so you only
get TLS if you ask for it.
2024-04-29 17:59:20 +02:00
Martin Hoffmann 4cab467eb9 Update changelog. 2024-04-29 17:42:57 +02:00
Martin HoffmannandGitHub 95a7218048 Update dependencies. (#304)
This PR updates all dependencies to their latest major version. This
requires some changes to the examples using tokio-rustls.

This PR also updates the minimum supported Rust version to 1.70.

This is a breaking change.
2024-04-29 17:41:07 +02:00
Ximon EighteenandGitHub bd2a60aa80 Remove unnecesary cookie postprocessor handling. (#301) 2024-04-25 20:16:22 +02:00
Martin Hoffmann 4d75f47831 Update changelog. 2024-04-24 17:36:05 +02:00
Martin HoffmannandGitHub e86a8e2fe3 Improve Debug impl for IANA types. (#298)
This PR changes the Debug implementation of the types in base::iana to show
a value as the constant if it matches it. E.g., Class(1) is now shown as
Class::IN.
2024-04-24 17:34:59 +02:00
Martin Hoffmann 665e223a0a Update changelog. 2024-04-24 16:27:06 +02:00
Martin HoffmannandGitHub ff618106fa Add Message::for_slice_ref. (#300)
This PR adds a new method Message<_>::for_slice_ref which converts the
message to a Message<&[u8]>. This comes in handy when parsing the message
content into type that don’t allow unsized octets sequences like
AllRecordData<_, _>.
2024-04-24 16:24:34 +02:00
Ximon EighteenandGitHub 50301b1f16 Fix adding of EDNS options. (#299)
* Add a test showing that adding ENDS options doesn't preserve EDNS OPT header fields as it should.
* Add `OptBuilder::clone_from()` and use it to preserve EDNS OPT header fields when adding EDNS options.
2024-04-24 16:12:12 +02:00
Ximon EighteenandGitHub dd14e59b27 Fix compilation with feature zonefile by moving zonetree related functionality out of zonefile. (#297)
Also:
- Adds missing RustDoc.
- Renames `OwnerError` to `ContextError` (as missing NS is not an issue per se with the owner of the record).
- Renames `into_result()` to `unwrap()` as that is how it behaves.
2024-04-24 15:01:31 +02:00
Martin Hoffmann a76a56fb2f Update changelog. 2024-04-24 12:24:04 +02:00
Martin HoffmannandGitHub 994c6442d7 Make dname_from_addr public. (#289)
This PR makes the helper method dname_from_addr for creating the query name
for a reverse pointer query public as an associated function on Dname. It
also improves the IPv4 version by avoiding the FromStr impl and creating the
domain name more properly.
2024-04-24 12:20:39 +02:00
Ximon EighteenandGitHub 080b81eee9 Explicitly terminate mock client connections once they have received all of their responses, rather than leave them connected till the end of the test to shutdown when the server shuts down. (#295) 2024-04-22 13:47:50 +02:00
Martin HoffmannandGitHub 7bcabb88bd Redefine stub resolver transport types. (#296)
This PR redefines the stub resolver’s Transport::Udp type to be
Transport::UdpTcp, i.e., use UDP but retry with TCP if the answer is
truncated and slightly reworks the server selection code in the stub
resolver to use all servers if use_vc is set.

This is a breaking change.
2024-04-22 13:35:20 +02:00
Martin Hoffmann c080d810fc Update changelog. 2024-04-22 13:34:06 +02:00
Martin HoffmannandGitHub 47655265dd Rename *Dname* to *Name*. (#290)
This PR renames all types and functions that refer to domain name from using
the term “dname” to just “name.” For instance, Dname becomes Name, ToDname
becomes ToName, and ToDname::to_dname becomes ToName::to_name.

This annoyingly wide-reaching change is motivated by a clash with the DNAME
record type that would always be confusing. So we rather do it now.

This is a really breaking change. Apologies.
2024-04-22 13:31:34 +02:00
Martin Hoffmann 3c7323a604 Fix changelog some more. 2024-04-12 10:40:27 +02:00
Martin Hoffmann 5d8040148c Fix changelog. 2024-04-12 10:31:04 +02:00
Martin Hoffmann cf237ee26e Update changelog. 2024-04-12 10:24:42 +02:00
Ximon EighteenandGitHub b5b411ee56 Add a queryable zone tree (#286)
This PR adds zonefile/parsed.rs, zonetree/ and related examples/, which
together enable, and show a library user how, to go from a zone file in
presentation format to an in-memory tree of zones which can be queried to
provide an answer, or walked (iterated over).

The tree also supports versioned write operations and a trait based zone
implementation allowing for the in-memory tree for a zone to instead be some
other (a)synchornous backing store (as demonstrated by the mysql-zone.rs
example).

The zonetree module is feature-gated behind the unstable-zonetree feature.
2024-04-12 10:21:21 +02:00
Martin Hoffmann 3a36b610e0 Update changelog. 2024-04-11 17:23:17 +02:00
Philip-NLnetLabsandGitHub 084c842eae Introduce a Timestamp type for Rrsig. (#294)
This PR splits the RRSIG timestamps from Serial into their own type
rdata::dnssec::Timestamp.

This PR is a breaking change.
2024-04-11 17:22:03 +02:00
Martin Hoffmann cf5288a57a Update changelog. 2024-04-11 16:44:54 +02:00
Ximon EighteenandGitHub 0bd1a68fe0 Add the net::server module. (#274)
This PR adds an unstable net::server module that enables the creation of UDP
and TCP DNS servers using base transport server, middleware and service building blocks.
2024-04-11 16:41:40 +02:00
Martin Hoffmann a88f0b3f1d Update changelog. 2024-04-11 16:30:27 +02:00
Philip-NLnetLabsandGitHub 938071241e Various ordering impls (#293)
This PR adds missing ordering impls to ZoneRecordData, AllRecordData,
Opt, and SvcbRdata.
2024-04-11 16:28:53 +02:00
Ximon Eighteen 1218118322 Typo correction in comment. 2024-04-11 09:46:31 +02:00
Philip Homburg 331858db5a Update changelog. 2024-04-08 17:19:31 +02:00
Philip Homburg c08b9cc951 Rename is_zsk to is_zone_key (PR #292). 2024-04-08 17:15:56 +02:00
Martin Hoffmann b37af5d5fd Update changelog. 2024-04-05 11:19:59 +02:00
Martin HoffmannandGitHub 8d9f686f47 Refactor IANA type variants into constants. (#276)
This PR changes the types for the IANA registered values into structs
wrapping underlying integer types and provides the values as constants. This
mostly just changes the spelling of those values. However, it also required
some re-wiring of the type generation macros for record data and opt data
since the type names and value names differ now.

This is a breaking change.
2024-04-05 11:16:23 +02:00
Martin Hoffmann 7cc3de6291 Update changelog. 2024-04-03 12:30:01 +02:00
Martin HoffmannandGitHub a660758410 Change ToDname/ToRelativeDname to have try_to_*name and to_*name pairs. (#285)
This PR changes the ToDname and ToRelativeDname traits to have a pair of
methods for each conversion that either return a result or just a success
value depending on whether the octets builder used for the name can fail.
This should allow removing quite a few unwraps when e.g. Vec<u8> or Bytes
are used.

This is a breaking change.
2024-04-03 12:27:54 +02:00
Martin Hoffmann 2dc27b8736 Update changelog. 2024-04-03 11:03:07 +02:00
Minghang ChenandGitHub edbbdecb88 Add AsRef impl for Record to allow for passing records by references when signing (#288)
This PR switches the validate::RrsigExt trait to accept anything that is
AsRef<Record<..>> instead of insisting on an actual Record so it can be
used with various smart pointers. It also adds an impl of AsRef<Self> to
Record to make this work.

This is a breaking change.
2024-04-03 11:00:16 +02:00
Martin Hoffmann 0f86a4b534 Fix warnings. 2024-03-25 12:26:20 +01:00
Ximon EighteenandGitHub b8a49f4491 Typo correction 2024-03-21 18:38:57 +01:00