Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSEC3 and multiple key signing support. #416

Open
wants to merge 390 commits into
base: main
Choose a base branch
from

Conversation

ximon18
Copy link
Member

@ximon18 ximon18 commented Oct 15, 2024

Currently lacks collision detection and tests, though has been manually tested using ldns-verify-zone, dnssec-verify and named-checkzone both with and without opt-out and also including both signed and unsigned delegations.

I'm posting this here as a draft to allow for alignment and early feedback from the team working on various pieces of DNSSEC support for domain.

@ximon18 ximon18 requested a review from a team October 15, 2024 14:18
@ximon18 ximon18 changed the title Initial NSEC3 generation support. NSEC3 generation support. Oct 17, 2024
bal-e added 23 commits October 24, 2024 16:13
There were bugs in the Base64 encoding/decoding that are not worth
trying to debug; there's a perfectly usable Base64 implementation in
the crate already.
I had to swap out the RSA key since 'ring' found it to be too small.
- RSA signatures were being made with an unspecified padding scheme.
- ECDSA signatures were being output in ASN.1 DER format, instead of
  the fixed-size format required by DNSSEC (and output by 'ring').
- Tests for signature failures are now added for both backends.
Most functions have been renamed.  The public key types have been moved
to the 'validate' module (which 'sign' now depends on), and they have
been outfitted with conversions (e.g. to and from DNSKEY records).

Importing a generic key into an OpenSSL or Ring key now requires the
public key to also be available.  In both implementations, the pair are
checked for consistency -- this ensures that both are uncorrupted and
that keys have not been mixed up.  This also allows the Ring backend to
support ECDSA keys (although key generation is still difficult).

The 'PublicKey' and 'PrivateKey' enums now store their array data in
'Box'.  This has two benefits: it is easier to securely manage memory
on the heap (since the compiler will not copy it around the stack); and
the smaller sizes of the types is beneficial (although negligibly) to
performance.
This makes space for higher-level interfaces which track DNSKEY flags
information (and possibly key rollover information).
Tests would spuriously fail when generated keys were only 31 bytes in
size.
This is more efficient than allocating a DNSKEY record and computing
the key tag there.
The test keys have been rotated and replaced with KSKs since they have
associated DS records I can verify digests against.  I also expanded
Ring's testing to include ECDSA keys.  The validate module tests SHA-1
keys as well, which aren't supported by 'sign'.
Public keys in the BIND format can now have multiple lines (even with
comments).  Keys can also be directly written into the BIND format and
round-trips to and from the BIND format are now tested.
partim and others added 23 commits December 18, 2024 11:44
Co-authored-by: Jannik Peters <[email protected]>
@ximon18 ximon18 changed the title NSEC3 generation support. NSEC3 and multiple key signing support. Dec 19, 2024
@ximon18 ximon18 marked this pull request as ready for review December 19, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants