"Bad NSEC data" when using zonesigner -usensec3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnssec-tools (Ubuntu) |
Triaged
|
High
|
Unassigned |
Bug Description
# apt-cache policy bind9 dnssec-tools
bind9:
Installed: 1:9.9.2.
Candidate: 1:9.9.2.
Version table:
*** 1:9.9.2.
500 http://
100 /var/lib/
dnssec-tools:
Installed: 2.0-1
Candidate: 2.0-1
Version table:
*** 2.0-1 0
500 http://
100 /var/lib/
# zonesigner -genkeys -usensec3 -zone groksecrecy.eu groksecrecy.
if zonesigner appears hung, strike keys until the program completes
(see the "Entropy" section in the man page for details)
Generating key pair.......++++++ ...........++++++
Generating key pair...
Generating key pair...
Verifying the zone using the following algorithms: RSASHA256.
Zone fully signed:
Algorithm: RSASHA256: KSKs: 1 active, 0 stand-by, 1 revoked
zone signed successfully
groksecrecy.eu:
KSK (cur) 59290 2048 08/21/13 (groksecrecy.
KSK (rev) 08224 2048 08/21/13 (groksecrecy.
ZSK (cur) 01110 1024 08/21/13 (groksecrecy.
ZSK (pub) 03480 1024 08/21/13 (groksecrecy.
zone will expire in 30 days
DO NOT delete the keys until this time has passed.
# donuts --level 9 -v -v -v -v -v groksecrecy.
--- loading rule file /usr/share/
rules: MEMORIZE_NS_ADDRS DNS_SERVERS_
--- loading rule file /usr/share/
rules: DNS_SOA_REQUIRED MEMORIZE_
--- loading rule file /usr/share/
rules: DNSSEC_
--- loading rule file /usr/share/
rules: DNSSEC_
--- loading rule file /usr/share/
rules: DNS_MULTIPLE_NS DNSSEC_
--- loading rule file /usr/share/
rules: DNS_REASONABLE_TTLS DNS_NO_
groksecrecy.
WARNING: failed to read groksecrecy.
bad NSEC data, line 155
# sed -n '155 p' groksecrecy.
TGJKMMT805KSMTJ
# cat groksecrecy.
$ttl 38400
@ IN SOA dns0.groksecrec
@ IN NS dns0
@ IN NS dns1
@ IN NS dns2
@ IN NS dns3
@ IN NS dns4
@ IN NS dns5
dns0 IN A 212.71.253.98
dns1 IN A 69.93.127.10
dns2 IN A 65.19.178.10
dns3 IN A 75.127.96.10
dns4 IN A 207.192.70.10
dns5 IN A 109.74.194.10
dns0 IN AAAA 2a01:7e00:
dns1 IN AAAA 2600:3c00::a
dns2 IN AAAA 2600:3c01::a
dns3 IN AAAA 2600:3c02::a
dns4 IN AAAA 2600:3c03::a
dns5 IN AAAA 2a01:7e00::a
@ IN A 212.71.253.98
mail IN A 212.71.253.98
@ IN AAAA 2a01:7e00:
mail IN AAAA 2a01:7e00:
www IN CNAME @
open IN CNAME @
@ IN MX 5 mail
@ IN TXT "v=spf1 a mx a:groksecrecy.net ~all"
I've tracked the error down to "/usr/share/ perl5/Net/ DNS/ZoneFile/ Fast.pm" . It has three tests which all report "bad NSEC data" so I added unique numbers into each error message. The 2nd one generates the error. It appears the fault is in the regular expression. The code is:
} elsif (/\G(nsec3)[ \t]+/igc) { (\d+)\s+ (\d+)\s+ (\d+)\s+ ([-0-9A- Fa-f]+) \s+($pat_ maybefullname) \s+(.*? )$pat_skip$ /gc) {
($1, $2, $3, $4, $5, $6);
$typelist = join(" ",sort split(/ \s+/,$typelist) ); :decode( uc($nxthash) );
Line => $ln,
name => $domain,
class => "IN",
ttl => $ttl,
type => "NSEC3",
hashalgo => $alg,
flags => $flags,
iterations => $iters,
hnxtname => $nxthash,
hnxtnamebin => $binhash,
hashlength => length($binhash),
salt => $salt,
saltbin => pack("H*",$salt),
saltlength => int(length( $salt)/ 2),
typelist => $typelist,
typebm =>
Net: :DNS::RR: :NSEC:: _typearray2type bm(split( /\s+/,$ typelist) ),
error(" bad NSEC data (#2)");
error ("You are missing required modules for NSEC3 support")
if (!$nsec3capable);
if (/\G\s*
# XXX: set the typebm field ourselves?
my ($alg, $flags, $iters, $salt, $nxthash, $typelist) =
my $binhash = MIME::Base32:
push @zone,
{
};
} else {
}
}