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 528 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
528 commits
Select commit Hold shift + click to select a range
39e1c9d
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 3, 2024
89eb673
Cargo fmt.
ximon18 Dec 3, 2024
323a14a
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 3, 2024
62f0199
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 3, 2024
af37a8e
Delete commented out code.
ximon18 Dec 3, 2024
9f70052
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 3, 2024
94b0de2
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 3, 2024
f784b9c
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 3, 2024
ab9b219
Revert tabbed output changes in preparation to use the PR #446 approa…
ximon18 Dec 3, 2024
3ce8640
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 3, 2024
7aac5ed
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 3, 2024
623f491
Adjust key usage strategy to support LDNS default behaviour of use ZS…
ximon18 Dec 5, 2024
3efb65e
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 5, 2024
9607ba0
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 5, 2024
9325956
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 5, 2024
8c2b140
Rename strategy fns to refer to what they are selecting more accurately.
ximon18 Dec 5, 2024
12c252f
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 5, 2024
e4a5bf9
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 5, 2024
b9f9b4a
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 5, 2024
ad795a9
Merge branch 'main' into initial-nsec3-generation
ximon18 Dec 5, 2024
33178c2
Merge branch 'initial-nsec3-generation' into multiple-key-signing
ximon18 Dec 5, 2024
10193c7
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 5, 2024
5f6f7e7
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 5, 2024
254b52f
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 5, 2024
bc68b0b
Make key selection more flexible. (#464)
ximon18 Dec 6, 2024
c7f26ac
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 6, 2024
6b7321c
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 6, 2024
64da561
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 6, 2024
7503455
Merge branch 'main' into initial-nsec3-generation
ximon18 Dec 6, 2024
15b72c0
Add a tab before the RDATA as well as within it, to match LDNS tabbed…
ximon18 Dec 6, 2024
5c23fdb
Update changelog.
ximon18 Dec 6, 2024
c141bf9
Add a tab before the RDATA as well as within it, to match LDNS tabbed…
ximon18 Dec 6, 2024
660d2f2
Update changelog.
ximon18 Dec 6, 2024
8c583b5
Add a tab before the RDATA as well as within it, to match LDNS tabbed…
ximon18 Dec 6, 2024
8f97bd3
Update changelog.
ximon18 Dec 6, 2024
85ffaf7
Add a tab before the RDATA as well as within it, to match LDNS tabbed…
ximon18 Dec 6, 2024
254dc9c
Update changelog.
ximon18 Dec 6, 2024
2359531
Raise errors instead of unwrapping on missing apex.
ximon18 Dec 7, 2024
f788ba5
Add a logging related TODO.
ximon18 Dec 7, 2024
dc79547
Also log the key tag when debug logging the keys to use for signing.
ximon18 Dec 7, 2024
02f64a4
Don't emit duplicate DNSKEY RRs for zonefiles that already contain th…
ximon18 Dec 7, 2024
ca982a4
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 7, 2024
68d7141
FIX: When extending SortedRecords, don't permit duplicate RRs to cree…
ximon18 Dec 7, 2024
200f0bb
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 7, 2024
31fabac
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 7, 2024
9c1cd42
Don't attempt to sign a zone or select keys to use if no keys are pro…
ximon18 Dec 9, 2024
80007c3
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 9, 2024
7f1bcb9
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 9, 2024
55c6975
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 9, 2024
99d4fcc
Improve signing keys debug output.
ximon18 Dec 9, 2024
b92f2f4
FIX: Only sign the apex if given the apex and remove unnecessary erro…
ximon18 Dec 9, 2024
69e8415
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 9, 2024
29cc4a1
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 9, 2024
9c82849
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 9, 2024
2a80b17
Actually check that we were given THE apex, not AN apex.
ximon18 Dec 9, 2024
518b4d7
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 9, 2024
2a956f7
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 9, 2024
23031e5
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 9, 2024
605efe6
Extend zone parsing to let the caller know when the origin has been d…
ximon18 Dec 12, 2024
493e870
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 12, 2024
3320bc9
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 12, 2024
7ff0cf8
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 12, 2024
f7b9351
Revert "Extend zone parsing to let the caller know when the origin ha…
ximon18 Dec 12, 2024
0a71293
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 12, 2024
529e6e6
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 12, 2024
0600feb
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 12, 2024
c0016c1
Use the correct TTL for added DNSKEY RRs when signing.
ximon18 Dec 16, 2024
8ba17e9
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 16, 2024
931d134
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 16, 2024
54ab872
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 16, 2024
b17fb85
FIX: Don't allow duplicate RRs to be imported via `impl From`.
ximon18 Dec 16, 2024
ed4fb30
Add a comment explaining why the apex name we use for an RRSIG meets …
ximon18 Dec 16, 2024
9aa7f7c
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 16, 2024
d3b3da5
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 16, 2024
d124294
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 16, 2024
c93eae7
Merge branch 'main' into initial-nsec3-generation
ximon18 Dec 16, 2024
bb0945a
Merge branch 'initial-nsec3-generation' into multiple-key-signing
ximon18 Dec 16, 2024
8aadb43
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 16, 2024
aeb6d93
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 16, 2024
c5c422d
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 16, 2024
2034f32
FIX: Sign a merged DNSKEY RR set containing existing and new DNSKEY R…
ximon18 Dec 17, 2024
9cb5d8d
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 17, 2024
d863dba
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 17, 2024
d6a3f1d
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 17, 2024
398e70b
Clippy-suggested code improvements.
partim Dec 18, 2024
f00acc6
WIP: Use a hash provider.
ximon18 Dec 18, 2024
ae94056
Update changelog.
partim Dec 18, 2024
f0d383e
[zonefile/inplace] Handle backslashes in quoted strings
ximon18 Dec 18, 2024
3943d26
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 18, 2024
7deffd0
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 18, 2024
bd7f436
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 18, 2024
a9aa52c
Merge branch 'main' into initial-nsec3-generation
ximon18 Dec 18, 2024
8d53906
Merge branch 'initial-nsec3-generation' into multiple-key-signing
ximon18 Dec 18, 2024
6586302
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 18, 2024
3319ec6
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 18, 2024
e4a3aec
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 18, 2024
1342d4c
FIX: Don't omit DNSKEY RRs when signing if there were no pre-exisitng…
ximon18 Dec 18, 2024
29105f5
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 18, 2024
dd120bc
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 18, 2024
8af5518
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 18, 2024
222d862
Don't hard-code NSEC3 hash capture, instead use a HashProvider.
ximon18 Dec 18, 2024
427dd83
Merge branch 'multiple-key-signing' into byo-signing-sorter-impl
ximon18 Dec 19, 2024
072cc4c
Merge branch 'byo-signing-sorter-impl' into sortedrecords-zonemd-remo…
ximon18 Dec 19, 2024
a98182b
Merge branch 'sortedrecords-zonemd-remove-replace' into sortedrecords…
ximon18 Dec 19, 2024
8911c93
Cargo fmt.
ximon18 Dec 19, 2024
4ad8177
Merge branch 'sortedrecords-zonemd-remove-replace-plus-pr444' into so…
ximon18 Dec 19, 2024
822c95a
Enhanced zone signing. (#418)
ximon18 Dec 19, 2024
4c96f94
Merge branch 'multiple-key-signing' into initial-nsec3-generation
ximon18 Dec 19, 2024
ea56b58
Merge branch 'main' into initial-nsec3-generation
ximon18 Dec 20, 2024
40c678c
Correct outdated code comment.
ximon18 Dec 27, 2024
7165146
Improved/additional logging during NSEC3 generation.
ximon18 Dec 27, 2024
e0cd687
Remove commented out code.
ximon18 Dec 27, 2024
f6df4fb
Make signing work with any objects as keys as long as they can answer…
ximon18 Jan 1, 2025
340a70a
Minor import cleanup.
ximon18 Jan 1, 2025
a4492ce
Comment tweaks.
ximon18 Jan 1, 2025
880f334
FIX: Neither NSEC and NSEC3 nor hashing should include non-authoritat…
ximon18 Jan 1, 2025
c90026d
Add Rtype::is_pseudo() for use by NSEC and NSEC3 logic.
ximon18 Jan 2, 2025
03b70ca
Implement MUST constraints from RFC 4034 and RFC 5155 excluding "pseu…
ximon18 Jan 2, 2025
844418e
Replace the Signer with access to signing via new traits SignableZone…
ximon18 Jan 5, 2025
35609cc
Cargo fmt.
ximon18 Jan 5, 2025
e663e65
Fix doc tests.
ximon18 Jan 5, 2025
b868b42
RustDoc fix.
ximon18 Jan 6, 2025
c2f1fbd
Better generic type name.
ximon18 Jan 6, 2025
6162b72
More descriptive and consistent fn name.
ximon18 Jan 6, 2025
28e2144
Add sorted_records::as_slice().
ximon18 Jan 6, 2025
0dbeffb
Also allow RRsets to be signed via trait fn which is simpler than cal…
ximon18 Jan 6, 2025
79d5b91
Clippy.
ximon18 Jan 6, 2025
e6d0844
FIX: Add missing required dependency to fix broken compilation of the…
ximon18 Jan 6, 2025
33beefe
Take out references to BIND and LDNS.
ximon18 Jan 6, 2025
fc29943
De-duplicate SignableZone::sign_zone() and SignableZoneInPlace::sign_…
ximon18 Jan 6, 2025
2e761c1
Remove the confusnig OctsMut generic type.
ximon18 Jan 6, 2025
ceab294
Default TTL for newly created non-NSEC(3) RRs should be that of the S…
ximon18 Jan 6, 2025
397ade4
Add TODO comment.
ximon18 Jan 7, 2025
ce3d52f
Merge branch 'main' into initial-nsec3-generation
ximon18 Jan 7, 2025
7e7d384
Remove unnecessary function.
ximon18 Jan 8, 2025
70a1894
Use Deref instead of adding a new RecordSlice trait.
ximon18 Jan 8, 2025
b7a65c0
Make it possible to construct SortedRecords without specifying the so…
ximon18 Jan 8, 2025
34f681a
Make the Default SigningConfig actually have default behaviour.
ximon18 Jan 8, 2025
5da1bb0
FIX: Don't panic when signing a zone that lacks a SOA.
ximon18 Jan 8, 2025
955d320
Start updating the RustDoc for the sign module.
ximon18 Jan 8, 2025
9e9baec
RustDoc formatting.
ximon18 Jan 8, 2025
d45960f
Remove errant backticks in RustDoc.
ximon18 Jan 8, 2025
51d5bed
Use user supplied sort impl everywhere, and require CanonicalOrd.
ximon18 Jan 9, 2025
ecf0f59
Merge branch 'main' into initial-nsec3-generation
ximon18 Jan 9, 2025
8d49648
Group and move things around in the sign module.
ximon18 Jan 9, 2025
174e694
Fix doc tests.
ximon18 Jan 9, 2025
7c3c995
Use the generic parameter name Inner everywhere for consistency.
ximon18 Jan 9, 2025
af545ff
Consistency.
ximon18 Jan 9, 2025
d5c31d7
Cargo fmt.
ximon18 Jan 9, 2025
681456a
Remove FamilyName, rename Family to OwnerRrs, and remove class checks…
ximon18 Jan 9, 2025
b1f7a20
As zone signing assumes, but does not check, that the zone is ordered…
ximon18 Jan 9, 2025
1056703
Revert "As zone signing assumes, but does not check, that the zone is…
ximon18 Jan 9, 2025
f563f32
Fix doc test.
ximon18 Jan 9, 2025
5549ba7
Pass an is_ent flag to the Nsec3Provider to allow it to be recorded f…
ximon18 Jan 9, 2025
f128a60
Rename remaining references to family.
ximon18 Jan 9, 2025
e8bbd08
Clippy.
ximon18 Jan 9, 2025
3fc8c01
Cleanup:
ximon18 Jan 10, 2025
f945240
RustDoc tweaks.
ximon18 Jan 10, 2025
87ba5c6
RustDoc tweaks.
ximon18 Jan 10, 2025
faaa7db
RustDoc tweaks.
ximon18 Jan 10, 2025
d26d620
RustDoc tweaks.
ximon18 Jan 10, 2025
d7ee3c0
FIX: When signing to another collection rather than in-place don't n…
ximon18 Jan 15, 2025
d134cca
Merge branch 'main' into initial-nsec3-generation
ximon18 Jan 16, 2025
55e333a
Undo unintended changes compared to main.
ximon18 Jan 16, 2025
28623dd
More RustDoc tweaks for the sign module, and restore the crypto commo…
ximon18 Jan 16, 2025
d20e52e
Fix broken doc tests.
ximon18 Jan 16, 2025
1aef63f
Cargo fmt.
ximon18 Jan 16, 2025
bcac30c
Move crypto errors in to the main error submodule of sign.
ximon18 Jan 16, 2025
bac2e8a
Re-export some types that live only in modules by the same name or wh…
ximon18 Jan 16, 2025
d23c1e8
Fix missing feature guards.
ximon18 Jan 16, 2025
2812600
Ensure re-exports refer only to descendants of the current module.
ximon18 Jan 16, 2025
8c2709a
Add missing RRSIG term in RustDoc comment.
ximon18 Jan 16, 2025
1f75a00
Rename the hashing module to authnext (authenticated non-existence) a…
ximon18 Jan 16, 2025
ba144e9
Minor RustDoc tweaks.
ximon18 Jan 16, 2025
e843da5
Cargo fmt.
ximon18 Jan 16, 2025
5a2959e
Rename the authnext module to authnonext which doesn't sound like the…
ximon18 Jan 16, 2025
d22880a
Rename authnonext to denial as ext is not really a good abbreviation …
ximon18 Jan 16, 2025
f4899e1
Move SigningConfig and signing::traits to the top of the sign module …
ximon18 Jan 16, 2025
495cc96
Delete empty sign::zone sub-module.
ximon18 Jan 16, 2025
501ae94
Minor RustDoc tweak.
ximon18 Jan 16, 2025
2f415a8
Add RustDoc for the `sign_zone()` function.
ximon18 Jan 16, 2025
d724fce
More `sign_zone()` RustDoc.
ximon18 Jan 16, 2025
1db6220
Typo correction.
ximon18 Jan 16, 2025
e8375ee
Typo correction.
ximon18 Jan 16, 2025
78b48eb
RustDoc correction.
ximon18 Jan 16, 2025
5a82490
Cargo fmt.
ximon18 Jan 16, 2025
5dd9a6f
More RustDoc.
ximon18 Jan 16, 2025
51f8352
Log each signed RRSET at trace level, not debug level.
ximon18 Jan 17, 2025
2d961d3
Remove unnecessary owner_name argument from sign_rrset(), don't requi…
ximon18 Jan 17, 2025
73e1e78
Reject attempts to sign an RRSIG RRset. (a) they should never be sign…
ximon18 Jan 17, 2025
6d61377
Reject invalid signature validity periods in sign_rrset().
ximon18 Jan 17, 2025
3644ca4
Typo fix in error message.
ximon18 Jan 17, 2025
0ab6294
Add a TODO comment.
ximon18 Jan 17, 2025
4fdf5a5
Add a debug time assert in sign_rrset() checking the label counts per…
ximon18 Jan 17, 2025
01e6b59
Add some RFC 4035 and 4035 based tests of sign_rrset().
ximon18 Jan 17, 2025
4f15520
RustDoc updates for the sign module.
ximon18 Jan 17, 2025
b15fab6
Cargo fmt.
ximon18 Jan 17, 2025
6a17341
Clippy.
ximon18 Jan 17, 2025
47760e8
Fix messed up test code.
ximon18 Jan 17, 2025
0e71ecd
Review feedback.
ximon18 Jan 17, 2025
041c92f
Corrected a RustDoc comment.
ximon18 Jan 17, 2025
b906e53
Corrected a RustDoc comment.
ximon18 Jan 17, 2025
287576e
Replace incorrect references to hashing which is only true for NSEC3,…
ximon18 Jan 17, 2025
fb4f159
Report the invalid signature validity period when sign_rrset() fails.
ximon18 Jan 17, 2025
8b53b6c
No need to check for pseudo RTYPEs being added as the input ZoneRecor…
ximon18 Jan 20, 2025
0755ee0
Determine the TTL for NSEC records within generate_nsecs() because it…
ximon18 Jan 20, 2025
dbd09b2
Add RustDoc for generate_nsecs().
ximon18 Jan 20, 2025
fe8fc8e
Add tests for generate_nsecs().
ximon18 Jan 20, 2025
df72cb4
Cargo fmt.
ximon18 Jan 20, 2025
b4b7e91
Clippy.
ximon18 Jan 20, 2025
9c6f866
Fix broken/missing RustDoc links.
ximon18 Jan 20, 2025
6321f73
Minor test name corrections.
ximon18 Jan 20, 2025
edc513b
- Make generate_rrsigs() take a config object instead of multiple con…
ximon18 Jan 20, 2025
3fc07c4
Minor cleanup of the way test keys are generated and used by generate…
ximon18 Jan 20, 2025
5fc894e
Require a version of Bytes that supports From<Box<[u8]>> (as Dnskey u…
ximon18 Jan 21, 2025
801fd2d
FIX: Don't sign the apex twice.
ximon18 Jan 21, 2025
671da3b
FIX: Don't skip signing when the apex isn't matched.
ximon18 Jan 21, 2025
48ec284
- Move test helper functions to a shared module.
ximon18 Jan 21, 2025
391d7dc
Use SmallVec instead of Vec, to avoid allocation for a small temporar…
ximon18 Jan 21, 2025
406818f
And missing line break.
ximon18 Jan 21, 2025
b281261
Fix compilation error.
ximon18 Jan 21, 2025
fdb5c66
FIX: At least one key for both roles is needed for signing.
ximon18 Jan 21, 2025
e701add
Additional RustDoc comments.
ximon18 Jan 21, 2025
c5cdf3c
FIX: Doc tests broken by recent logic fix.
ximon18 Jan 21, 2025
5b4c4fe
Default to adding missing DNSKEY RRs, as RFC 4035 section 2.1 require…
ximon18 Jan 21, 2025
294770d
FIX: Adding records to SortedRecords via iterator should also use ext…
ximon18 Jan 21, 2025
614d815
Better parameter name.
ximon18 Jan 21, 2025
f6c2ce5
Minor improvements.
ximon18 Jan 21, 2025
94cf97d
Extend testing of generate_rrsigs() with a full zone to cover various…
ximon18 Jan 21, 2025
8984921
Clippy.
ximon18 Jan 21, 2025
019934c
FIX: Inverted flag.
ximon18 Jan 21, 2025
ab40d90
Organize imports.
ximon18 Jan 22, 2025
0f7ca2b
Add test for generating RRSIGs without adding DNSKEYs.
ximon18 Jan 22, 2025
e7d2460
Rename parameter.
ximon18 Jan 22, 2025
976b83e
Use existing helper fns to simplify test code.
ximon18 Jan 22, 2025
26911fd
Add missing [must_use] attributes.
ximon18 Jan 22, 2025
0bd93ec
Correct / generalize old comments.
ximon18 Jan 22, 2025
ffa16b3
Ah, the [must_use] are already inffered and duplicate and annoy Clipp…
ximon18 Jan 22, 2025
3717c66
Corrections and additions to the RustDoc for generate_rrsigs().
ximon18 Jan 22, 2025
1887d7e
Add a test of calling generate_rrsigs() on an already signed zone.
ximon18 Jan 22, 2025
7764e6b
- Remove the DNSKEY RRs from the input test zonefile as it is assumed…
ximon18 Jan 22, 2025
d807d4b
- Also use SmallVec here.
ximon18 Jan 22, 2025
2f39e2f
Merge branch 'main' into initial-nsec3-generation
ximon18 Jan 22, 2025
56ce3b0
Normalize the generate_xxx interfaces to take config objects and retu…
ximon18 Jan 23, 2025
0680c1f
Fix broken doc test, restore flexible signature for Default impl for …
ximon18 Jan 23, 2025
14cd78f
More normalization of the generate_xxx interfaces to take config obje…
ximon18 Jan 23, 2025
5efcccf
Initial NSEC3 unit tests based on existing NSEC tests.
ximon18 Jan 23, 2025
1660cba
Fix missing feature dependency.
ximon18 Jan 27, 2025
13f8e51
Take validity time for a signature as input to signing, not from a ke…
ximon18 Jan 30, 2025
4910b9b
Impl Display for IntendedKeyPurpose.
ximon18 Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 16 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ octseq = { version = "0.5.2", default-features = false }
time = { version = "0.3.1", default-features = false }
rand = { version = "0.8", optional = true }
arc-swap = { version = "1.7.0", optional = true }
bytes = { version = "1.0", optional = true, default-features = false }
bytes = { version = "1.2", optional = true, default-features = false }
chrono = { version = "0.4.35", optional = true, default-features = false } # 0.4.35 deprecates Duration::seconds()
futures-util = { version = "0.3", optional = true }
hashbrown = { version = "0.14.2", optional = true, default-features = false, features = ["allocator-api2", "inline-more"] } # 0.14.2 introduces explicit hashing
Expand Down Expand Up @@ -73,7 +73,7 @@ zonefile = ["bytes", "serde", "std"]
# Unstable features
unstable-client-transport = ["moka", "net", "tracing"]
unstable-server-transport = ["arc-swap", "chrono/clock", "libc", "net", "siphasher", "tracing"]
unstable-sign = ["std", "dep:secrecy", "unstable-validate", "time/formatting"]
unstable-sign = ["std", "dep:secrecy", "dep:smallvec", "dep:serde", "time/formatting", "tracing", "unstable-validate"]
unstable-stelline = ["tokio/test-util", "tracing", "tracing-subscriber", "tsig", "unstable-client-transport", "unstable-server-transport", "zonefile"]
unstable-validate = ["bytes", "std", "ring"]
unstable-validator = ["unstable-validate", "zonefile", "unstable-client-transport"]
Expand All @@ -84,19 +84,20 @@ unstable-zonetree = ["futures-util", "parking_lot", "rustversion", "serde", "std
arbitrary = ["dep:arbitrary"]

[dev-dependencies]
itertools = "0.13.0"
lazy_static = { version = "1.4.0" }
rstest = "0.19.0"
rustls-pemfile = { version = "2.1.2" }
serde_test = "1.0.130"
serde_json = "1.0.113"
serde_yaml = "0.9"
socket2 = { version = "0.5.5" }
tokio = { version = "1.37", features = ["rt-multi-thread", "io-util", "net", "test-util"] }
tokio-rustls = { version = "0.26", default-features = false, features = [ "ring", "logging", "tls12" ] }
tokio-test = "0.4"
tokio-tfo = { version = "0.2.0" }
webpki-roots = { version = "0.26" }
itertools = "0.13.0"
lazy_static = { version = "1.4.0" }
pretty_assertions = "1.4.1"
rstest = "0.19.0"
rustls-pemfile = { version = "2.1.2" }
serde_test = "1.0.130"
serde_json = "1.0.113"
serde_yaml = "0.9"
socket2 = { version = "0.5.5" }
tokio = { version = "1.37", features = ["rt-multi-thread", "io-util", "net", "test-util"] }
tokio-rustls = { version = "0.26", default-features = false, features = [ "ring", "logging", "tls12" ] }
tokio-test = "0.4"
tokio-tfo = { version = "0.2.0" }
webpki-roots = { version = "0.26" }

# For the "mysql-zone" example
#sqlx = { version = "0.6", features = [ "runtime-tokio-native-tls", "mysql" ] }
Expand Down
2 changes: 1 addition & 1 deletion examples/keyset.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Demonstrate the use of key sets.
use domain::base::Name;
use domain::sign::keyset::{
use domain::sign::keys::keyset::{
Action, Error, KeySet, KeyType, RollType, UnixTime,
};
use itertools::{Either, Itertools};
Expand Down
2 changes: 2 additions & 0 deletions src/base/iana/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub use self::rcode::{OptRcode, Rcode, TsigRcode};
pub use self::rtype::Rtype;
pub use self::secalg::SecAlg;
pub use self::svcb::SvcParamKey;
pub use self::zonemd::{ZonemdAlg, ZonemdScheme};

#[macro_use]
mod macros;
Expand All @@ -49,3 +50,4 @@ pub mod rcode;
pub mod rtype;
pub mod secalg;
pub mod svcb;
pub mod zonemd;
50 changes: 50 additions & 0 deletions src/base/iana/zonemd.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//! ZONEMD IANA parameters.

//------------ ZonemdScheme --------------------------------------------------

int_enum! {
/// ZONEMD schemes.
///
/// This type selects the method by which data is collated and presented
/// as input to the hashing function for use with [ZONEMD].
///
/// For the currently registered values see the [IANA registration]. This
/// type is complete as of 2024-11-29.
///
/// [ZONEMD]: ../../../rdata/zonemd/index.html
/// [IANA registration]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#zonemd-schemes
=>
ZonemdScheme, u8;

/// Specifies that the SIMPLE scheme is used.
(SIMPLE => 1, "SIMPLE")
}

int_enum_str_decimal!(ZonemdScheme, u8);
int_enum_zonefile_fmt_decimal!(ZonemdScheme, "scheme");

//------------ ZonemdAlg -----------------------------------------------------

int_enum! {
/// ZONEMD algorithms.
///
/// This type selects the algorithm used to hash domain names for use with
/// the [ZONEMD].
///
/// For the currently registered values see the [IANA registration]. This
/// type is complete as of 2024-11-29.
///
/// [ZONEMD]: ../../../rdata/zonemd/index.html
/// [IANA registration]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#zonemd-hash-algorithms
=>
ZonemdAlg, u8;

/// Specifies that the SHA-384 algorithm is used.
(SHA384 => 1, "SHA384")

/// Specifies that the SHA-512 algorithm is used.
(SHA512 => 2, "SHA512")
}

int_enum_str_decimal!(ZonemdAlg, u8);
int_enum_zonefile_fmt_decimal!(ZonemdAlg, "hash algorithm");
29 changes: 27 additions & 2 deletions src/net/server/middleware/xfr/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use octseq::Octets;
use tokio::sync::Semaphore;
use tokio::time::Instant;

use crate::base::iana::{Class, OptRcode, Rcode};
use crate::base::iana::{Class, DigestAlg, OptRcode, Rcode, SecAlg};
use crate::base::{
Message, MessageBuilder, Name, ParsedName, Rtype, Serial, ToName, Ttl,
};
Expand All @@ -32,7 +32,7 @@ use crate::net::server::service::{
CallResult, Service, ServiceError, ServiceFeedback, ServiceResult,
};
use crate::rdata::{
Aaaa, AllRecordData, Cname, Mx, Ns, Soa, Txt, ZoneRecordData, A,
Aaaa, AllRecordData, Cname, Ds, Mx, Ns, Soa, Txt, ZoneRecordData, A,
};
use crate::tsig::{Algorithm, Key, KeyName};
use crate::zonefile::inplace::Zonefile;
Expand Down Expand Up @@ -74,6 +74,31 @@ async fn axfr_with_example_zone() {
(n("example.com"), Aaaa::new(p("2001:db8::3")).into()),
(n("www.example.com"), Cname::new(n("example.com")).into()),
(n("mail.example.com"), Mx::new(10, n("example.com")).into()),
(n("a.b.c.mail.example.com"), A::new(p("127.0.0.1")).into()),
(n("x.y.mail.example.com"), A::new(p("127.0.0.1")).into()),
(n("some.ent.example.com"), A::new(p("127.0.0.1")).into()),
(
n("unsigned.example.com"),
Ns::new(n("some.other.ns.net.example.com")).into(),
),
(
n("signed.example.com"),
Ns::new(n("some.other.ns.net.example.com")).into(),
),
(
n("signed.example.com"),
Ds::new(
60485,
SecAlg::RSASHA1,
DigestAlg::SHA1,
crate::utils::base16::decode(
"2BB183AF5F22588179A53B0A98631FAD1A292118",
)
.unwrap(),
)
.unwrap()
.into(),
),
(n("example.com"), zone_soa.into()),
];

Expand Down
5 changes: 5 additions & 0 deletions src/rdata/dnssec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,11 @@ impl<Octs: AsRef<[u8]>> RtypeBitmap<Octs> {
) -> Result<(), Target::AppendError> {
target.append_slice(self.0.as_ref())
}

#[must_use]
pub fn is_empty(&self) -> bool {
self.iter().next().is_none()
}
}

//--- AsRef
Expand Down
42 changes: 41 additions & 1 deletion src/rdata/nsec3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ impl<Octs> Nsec3<Octs> {
&self.next_owner
}

pub fn set_next_owner(&mut self, next_owner: OwnerHash<Octs>) {
self.next_owner = next_owner;
}

pub fn types(&self) -> &RtypeBitmap<Octs> {
&self.types
}
Expand Down Expand Up @@ -354,7 +358,10 @@ impl<Octs: AsRef<[u8]>> fmt::Display for Nsec3<Octs> {
self.hash_algorithm, self.flags, self.iterations, self.salt
)?;
base32::display_hex(&self.next_owner, f)?;
write!(f, " {}", self.types)
if !self.types.is_empty() {
write!(f, " {}", self.types)?;
}
Ok(())
}
}

Expand Down Expand Up @@ -453,6 +460,10 @@ impl<Octs> Nsec3param<Octs> {
&self.salt
}

pub fn into_salt(self) -> Nsec3Salt<Octs> {
self.salt
}

pub(super) fn convert_octets<Target>(
self,
) -> Result<Nsec3param<Target>, Target::Error>
Expand Down Expand Up @@ -496,6 +507,35 @@ impl<Octs> Nsec3param<Octs> {
}
}

//--- Default

impl<Octs> Default for Nsec3param<Octs>
where
Octs: From<&'static [u8]>,
{
/// Best practice default values for NSEC3 hashing.
///
/// Per [RFC 9276] section 3.1:
///
/// - _SHA-1, no extra iterations, empty salt._
///
/// Per [RFC 5155] section 4.1.2:
///
/// - _The Opt-Out flag is not used and is set to zero._
/// - _All other flags are reserved for future use, and must be zero._
///
/// [RFC 5155]: https://www.rfc-editor.org/rfc/rfc5155.html
/// [RFC 9276]: https://www.rfc-editor.org/rfc/rfc9276.html
fn default() -> Self {
Self {
hash_algorithm: Nsec3HashAlg::SHA1,
flags: 0,
iterations: 0,
salt: Nsec3Salt::empty(),
}
}
}

//--- OctetsFrom

impl<Octs, SrcOcts> OctetsFrom<Nsec3param<SrcOcts>> for Nsec3param<Octs>
Expand Down
Loading