Fix NSEC(3) with no bitmap

This commit is contained in:
Miek Gieben 2012-01-23 11:30:26 +01:00
parent 5ec63eab34
commit 6e6b67afd5
3 changed files with 6 additions and 3 deletions

View File

@ -16,8 +16,6 @@ things that need to be fixed.
## BUGS
* NSEC3 records with no bitmap (empty non-terminals) are not correctly verified
* This means they are not correctly put in wirefmt also;
* Not completely sure wildcard handling when verifying is correct;
* Timeouts - they may be set way too short.

View File

@ -162,7 +162,7 @@ func TestDnskey(t *testing.T) {
t.Fail()
}
// Coefficient looks fishy...
// println(pubkey.(*RR_DNSKEY).PrivateKeyString(privkey))
t.Logf("%s", pubkey.(*RR_DNSKEY).PrivateKeyString(privkey))
}

5
msg.go
View File

@ -420,6 +420,11 @@ func packStructValue(val reflect.Value, msg []byte, off int, compression map[str
}
case "NSEC": // NSEC/NSEC3
// This is the uint16 type bitmap
if val.Field(i).Len() == 0 {
// Do absolutely nothing
break
}
lastwindow := uint16(0)
length := uint16(0)
if off+2 > len(msg) {