Subject: | !hex! error when parsing NSEC3 with empty salt |
Section 3.3 of RFC 5155 states that:
o The Salt field is represented as a sequence of case-insensitive
hexadecimal digits. Whitespace is not allowed within the
sequence. The Salt field is represented as "-" (without the
quotes) when the Salt Length field has a value of 0.
However, Net::DNS::RR::NSEC3::salt() will die if it encounters a salt field which contains "-":
sub salt {
my $self = shift;
$self->saltbin( pack "H*", map { die "!hex! ($_)" if m/[^0-9A-Fa-f]/; $_ } join "", @_ ) if scalar @_;
unpack "H*", $self->saltbin() if defined wantarray;
}