Key::parse_from_bind()
cannot parse a file that ends with a line break.
#466
Labels
Key::parse_from_bind()
cannot parse a file that ends with a line break.
#466
Given the following
.key
fileKey::parse_from_bind()
is able to parse it successfully:Change it by adding a line break at the end however and
Key::parse_from_bind()
fails with errorParseDnskeyTextError::Misformatted
.One can argue "but tools only generate valid files" so this isn't an issue but if it must be strict I would prefer a more useful error (I spent >10 minutes investigating this as I assumed some other part of the input was incorrect).
Yes I hit this issue because I didn't generate the file using a tool like
ldns-keygen
but instead copied a.key
file content from test code into an actual file on disk and accidentally added a trailing line break while doing so, so one can attribute this to user error, but this poor user would appreciate a better error message...The text was updated successfully, but these errors were encountered: