Skip to content

Commit

Permalink
Rename variable diagnostic_comments to extra_comments because comment…
Browse files Browse the repository at this point in the history
…s must always output (e.g. for DNSKEY).

Add sorting to match LDNS signzone zone file ordered output.

Moves per type comment output into impls of new trait `Commented`.
  • Loading branch information
ximon18 committed Nov 22, 2024
1 parent adbaf06 commit 9eb17c2
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 70 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ path = "src/bin/ldns.rs"
[dependencies]
bytes = { version = "1.1", default-features = false }
clap = { version = "4.3.4", features = ["cargo", "derive"] }
domain = { git = "https://github.com/NLnetLabs/domain", branch = "multiple-key-signing", features = [
domain = { git = "https://github.com/NLnetLabs/domain", branch = "support-zonefile-fmt-with-padding", features = [
"bytes",
"openssl",
"ring",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/key2ds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl Key2ds {
let rr = Record::new(owner, class, ttl, ds);

if self.write_to_stdout {
writeln!(env.stdout(), "{}", rr.display_zonefile(false));
writeln!(env.stdout(), "{}", rr.display_zonefile(false, true));
} else {
let owner = owner.fmt_with_dot();
let sec_alg = sec_alg.to_int();
Expand Down Expand Up @@ -210,7 +210,7 @@ impl Key2ds {
let mut out_file =
res.map_err(|e| format!("Could not create file \"{filename}\": {e}"))?;

writeln!(out_file, "{}", rr.display_zonefile(false))
writeln!(out_file, "{}", rr.display_zonefile(false, true))
.map_err(|e| format!("Could not write to file \"{filename}\": {e}"))?;

writeln!(env.stdout(), "{keyname}");
Expand Down
Loading

0 comments on commit 9eb17c2

Please sign in to comment.