+2012-08-28 Bob Halley <halley@dnspython.org>
+
+ * dns/rdtypes/ANY/NSEC3.py (NSEC3.from_text): The NSEC3 from_text()
+ method could erroneously emit empty bitmap windows (i.e. windows
+ with a count of 0 bytes); such bitmaps are illegal.
+
2012-04-10 Bob Halley <halley@dnspython.org>
* dns/dnssec.py (_validate_rrsig): Fix python3 port issues with
prior_rdtype = nrdtype
new_window = nrdtype // 256
if new_window != window:
- windows.append((window, bytes(bitmap[0:octets])))
+ if octets != 0:
+ windows.append((window, bytes(bitmap[0:octets])))
bitmap = bytearray(32)
window = new_window
offset = nrdtype % 256
bit = offset % 8
octets = byte + 1
bitmap[byte] = bitmap[byte] | (0x80 >> bit)
- windows.append((window, bytes(bitmap[0:octets])))
+ if octets != 0:
+ windows.append((window, bytes(bitmap[0:octets])))
return cls(rdclass, rdtype, algorithm, flags, iterations, salt, next, windows)
from_text = classmethod(from_text)
ttl = dns.ttl.from_text("2147483648")
self.assertRaises(dns.ttl.BadTTL, bad)
+ def test_empty_NSEC3_window(self):
+ rdata = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.NSEC3,
+ "1 0 100 ABCD SCBCQHKU35969L2A68P3AD59LHF30715")
+ self.assertTrue(rdata.windows == [])
+
if __name__ == '__main__':
unittest.main()