Subject: | Net::DNS::SEC incorrectly decodes (from text) an NSEC3PARAM record with null salt |
Date: | Fri, 25 Apr 2014 09:34:33 +0000 |
To: | "bug-Net-DNS-SEC [...] rt.cpan.org" <bug-Net-DNS-SEC [...] rt.cpan.org> |
From: | Anthony Kirby <Anthony.Kirby [...] nominet.org.uk> |
I believe I've found a bug in Net::DNS::SEC's handling of NSEC3PARAM records which have null salt. When initialised from text, the null salt (which is specified as "-" in text format) gets (un)packed to saltbin as if it were valid hex, which produces a non-null & hence bogus salt when serialised to wire format.
(I imagine that if some versions of Perl have a pickier implementation of pack(), new_from_text might instead just fail & return an undef instead)
The fix is to check for the text "-" and infer null salt.
I've attached a patch for NSEC3PARAM.pm & an updated test 12-nsec++.t which reproduces the issue.
Environment:
Net::DNS 0.74
Net::DNS::SEC 0.17
Perl 5.10.1
Linux - RHEL 6, Ubuntu 10.4
many thanks
Anthony
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.