Accept mnemonics in zonefile scanner for int_enum_str_decimal types - #704
Accept mnemonics in zonefile scanner for int_enum_str_decimal types#704SebastiaanYN wants to merge 2 commits into
Conversation
`scan_impl!` for `int_enum_str_decimal` types only accepted decimal numbers via `FromStr`. Add `from_mnemonic` as a fallback so zone files can use `RSASHA256` instead of `8` for `SecurityAlgorithm`.
|
Hello @SebastiaanYN Thank you very much for this PR and all the others. While this change would certainly resolve the issue for For example, We have encountered this issue ourselves before and tried to solve it. Unfortunately, we were unable to do so without breaking In case you are interested in our approach: diff --git a/src/base/iana/secalg.rs b/src/base/iana/secalg.rs
index 82d222395..d19e30e15 100644
--- a/src/base/iana/secalg.rs
+++ b/src/base/iana/secalg.rs
@@ -116,5 +116,9 @@ int_enum! {
(PRIVATEOID => 254, "PRIVATEOID")
}
-int_enum_str_decimal!(SecurityAlgorithm, u8);
+int_enum_str_with_decimal!(
+ SecurityAlgorithm,
+ u8,
+ "unknown security algorithm"
+);The above change resolves the parsing issue by modifying the implementation. However, this change affects the |
|
Thanks for taking a look at the PR. I did overlook that only I pushed another commit that modifies the Hopefully this is a reasonable solution without doing larger refactoring |
02fd705 to
0252efc
Compare
scan_impl!forint_enum_str_decimaltypes only accepted decimal numbers viaFromStr. Addfrom_mnemonicas a fallback so zone files can useRSASHA256instead of8forSecurityAlgorithm.