Commit Graph
101 Commits
Author SHA1 Message Date
Ximon Eighteen 18e4007253 Warning and error logging refactoring and cleanup. 2024-11-27 09:40:52 +01:00
Ximon Eighteen 7b2659fbf3 Remove commented out code. 2024-11-27 09:20:52 +01:00
Ximon Eighteen a7503e44a1 Remove duplicate comment. 2024-11-27 09:19:06 +01:00
Ximon Eighteen 8ec7479be5 Remove unused code. 2024-11-27 08:59:25 +01:00
Ximon Eighteen b0b4c10a31 Remove incorrect formatting logic. 2024-11-27 08:56:31 +01:00
Ximon Eighteen fd08b03487 Removed outdated TODO comment. 2024-11-27 08:50:35 +01:00
Ximon Eighteen 5ec81278cd Update help texts to match updated key discovery behaviour. 2024-11-27 08:50:23 +01:00
Ximon Eighteen d68c919f60 Fix lifetime error. 2024-11-27 00:12:03 +01:00
Ximon Eighteen 221bba1aa7 Cargo fmt. 2024-11-26 23:55:03 +01:00
Ximon Eighteen 724846ac00 Add LDNS style warnings about chosen iteration counts. 2024-11-26 23:54:56 +01:00
Ximon Eighteen 6297442e68 Factor out ANSI colourisation support. 2024-11-26 23:54:36 +01:00
Ximon Eighteen 5894db770d Pass an is_ldns flag to commands. 2024-11-26 23:54:10 +01:00
Ximon Eighteen 3d16bb337a Move ? operator to more logical location: attached to the fn call it relates to. 2024-11-26 23:52:30 +01:00
Ximon Eighteen 084d9a4a8b Remove commented out code. 2024-11-26 23:51:46 +01:00
Ximon Eighteen 0cc0535df1 Change 'A' custom dnst option to 'P' because 'A' is needed for an existing LDNS option. 2024-11-26 17:05:51 +01:00
Ximon Eighteen add8bdb052 Improved LDNS compatibility: Use DNSKEY RRs that correspond to loaded private keys else fall back to loading public keys. 2024-11-26 12:11:19 +01:00
Ximon Eighteen e2f1d86e56 Add missing import. 2024-11-25 15:56:02 +01:00
Ximon Eighteen a47dd4efcc Fix tests. 2024-11-25 15:55:38 +01:00
Ximon EighteenandGitHub 02bd14d9ec Don't over allocate. 2024-11-25 15:46:44 +01:00
Ximon Eighteen 86b56535d8 Make LDNS output re-ordering for readability an optional off-by-default behaviour as it is performance impacting and not required for valid signed zone output. 2024-11-25 15:29:24 +01:00
Ximon Eighteen 342144ac3c Improve zone writing performance by buffering output. 2024-11-25 15:14:33 +01:00
Ximon Eighteen 844ca3cfdb Merge branch 'main' into add-ldns-like-sign-zone-support 2024-11-25 15:08:51 +01:00
Ximon Eighteen bb46747954 Support LDNS keys must match zone functionality. 2024-11-25 14:59:25 +01:00
Terts DiepraamandGitHub 7036a583f7 Merge pull request #33 from NLnetLabs/rework-matching-on-ldns
Rework ldns command matching to use file-stem and give errors
2024-11-22 16:31:50 +01:00
9744d9e1ca Add nsec3-hash command. (#6)
Co-authored-by: Jannik <jannik@nlnetlabs.nl>
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2024-11-22 13:48:10 +01:00
arya dradjicaandGitHub 18dd6e7ebc [error] Add 'bail' and 'ensure' macros (#29)
* [error] Add 'bail' and 'ensure' macros

* [error] Export 'bail' and 'ensure' from the right module

* [error] Document macro exporting trick

* [error] Adjust semicolons in bail macros
2024-11-22 13:27:06 +01:00
Terts Diepraam 178468ce00 rework ldns command matching to use file-stem and give errors 2024-11-22 11:59:49 +01:00
Ximon Eighteen 5dfff42c22 Always output comments for DNSKEY RRs. 2024-11-22 11:45:21 +01:00
Ximon Eighteen 9eb17c2528 Rename variable diagnostic_comments to extra_comments because comments 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`.
2024-11-22 11:43:20 +01:00
Jannik Peters adbaf06e55 Clippy 2024-11-21 17:02:57 +01:00
Jannik Peters 907a63438c Fix error without keys 2024-11-21 16:42:28 +01:00
Jannik Peters 32ca8f7ca0 Fix writing to stdout or file 2024-11-21 16:40:41 +01:00
Jannik Peters f46fdd9683 Format 2024-11-20 12:53:29 +01:00
Jannik Peters 9cdba55750 Merge branch 'main' into add-ldns-like-sign-zone-support 2024-11-20 12:39:23 +01:00
Terts DiepraamandGitHub 511c8f1f6a Implement Key2ds (#2) 2024-11-19 13:45:18 +01:00
Terts DiepraamandGitHub a014f13c09 Make the output of Env::std{out, err} a concrete type (#27)
* make the output of Env::std{out, err} a concrete type

* document why the unwrap in write_fmt is okay
2024-11-15 16:13:35 +01:00
18d56a6431 Introduce an Env trait to mock the outside world (#23)
* introduce and Env trait to mock the outside world

* make argument parsing unit-testable

* add get_stderr to FakeEnv

* fakecmd and print errors into the env

* change ExitCode::from to into

Co-authored-by: Ximon Eighteen <3304436+ximon18@users.noreply.github.com>

* update some comments

* cargo fmt

* document some more of the testing utilities

* use exit_code method on clap errors

* bump minimal clap version

* reexport RealEnv

* remove .lock() calls for stdout and stderr

* remove args field from FakeCmd

* improve docs for Env

* cargo fmt

* use mutex in FakeStream

* improve FmtWriter implementation for a tiny bit more performance

* car go ffffffmmmmmmtttttt

---------

Co-authored-by: Ximon Eighteen <3304436+ximon18@users.noreply.github.com>
2024-11-15 13:47:18 +01:00
Terts DiepraamandGitHub 5874f11dcc Add ldns binary for easier testing of ldns tools (#20) 2024-11-12 16:34:08 +01:00
Ximon Eighteen edd863826b Update ldns-signzone to use new lexopt parser. Change dnst signzone default number of NSEC3 iterations to zero to match RFC 9276. 2024-11-11 23:11:00 +01:00
Ximon Eighteen 01dba27868 Merge branch 'main' into add-ldns-like-sign-zone-support 2024-11-11 23:02:04 +01:00
8dc82c7ff6 Add context tracking for errors (#18)
* [error] Introduce context tracking

* [error] Add an extension trait to 'Result'

* [error] Move pretty-printing to explicit function

* Pretty-print errors on exit

* [erro] Fix primary field documentation

---------

Co-authored-by: arya dradjica <arya@nlnetlabs.nl>
2024-11-11 19:55:46 +01:00
bae3b00041 Separate ldns parsing from clap parsing (#19)
* Separate ldns parsing from clap parsing

Co-authored-by: Jannik Peters <jannik@nlnetlabs.nl>

* nsec3-hash: sort ldns argument parsing alphabetically

* abort ldns parsing early on malfored argv[0]

* add 'Error' prefix to ldns parsing errors

* use clap default exit code of 2 for dnst versions of commands

* remove args_overide_self from nsec3hash

* move parse_os and parse_os_with out of LdnsCommand

---------

Co-authored-by: Jannik Peters <jannik@nlnetlabs.nl>
2024-11-11 15:52:26 +01:00
Ximon Eighteen df8426976d Remove guidance concerning key files in help text which is correct for ldns-signzone but not yet supported by dnst signzone.
Also, remove hard-coded line breaks in the help tetx so that the terminal can wrap the text as it will the rest of the help.
2024-11-08 13:30:04 +01:00
Ximon Eighteen a82778af0b Use new domain key size support to output size = 256b or similar in DNSKEY RR comments to match ldns-signzone behaviour. 2024-11-08 13:25:06 +01:00
Ximon Eighteen 44c9a25a81 Also output DNSKEY RR comments when -b is not provided, to match ldns-signzone behaviour. 2024-11-07 22:12:46 +01:00
Ximon Eighteen 8d6b807a1f Add support for -u including its undocumented +1 behaviour. 2024-11-07 14:32:03 +01:00
Ximon Eighteen 231f0c74ec Cleanup imports. 2024-11-07 13:19:53 +01:00
Ximon Eighteen da4737f423 Make -f <zonefile>.signed the default behaviour. 2024-11-07 13:18:32 +01:00
Ximon Eighteen 3e11af384c Add '-f' support.
Add multiple '-b' support to override disabling of '-b' when '-f -' is used.
2024-11-07 13:05:02 +01:00
Ximon Eighteen 4ff8107ebe Add '-f' support.
Add multiple '-b' support to override disabling of '-b' when '-f -' is used.
2024-11-07 13:03:52 +01:00