Codebase list dnspython / 0ec9807
Add debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from- text.patch from upstream (Closes: #915866) Conflicts: debian/changelog Scott Kitterman 5 years ago
3 changed file(s) with 78 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 dnspython (1.15.0-1+deb9u1) UNRELEASED; urgency=medium
1
2 * Add debian/patches/0002-fix-error-when-parsing-nsec3-bitmap-from-
3 text.patch from upstream (Closes: #915866)
4
5 -- Scott Kitterman <scott@kitterman.com> Fri, 07 Dec 2018 08:23:43 -0500
6
07 dnspython (1.15.0-1) unstable; urgency=medium
18
29 * New upstream release
0 From: =?utf-8?q?Filip_=C5=A0irok=C3=BD?= <filip.siroky@nic.cz>
1 Date: Thu, 13 Jul 2017 17:01:19 +0200
2 Subject: fix error when parsing nsec3 bitmap from text
3
4 Exception is raised when parsing nsec3 bitmap into multiple windows
5 Add test to prove the change fixes the issue
6 ---
7 dns/rdtypes/ANY/NSEC3.py | 2 +-
8 tests/test_nsec3.py | 39 +++++++++++++++++++++++++++++++++++++++
9 2 files changed, 40 insertions(+), 1 deletion(-)
10 create mode 100644 tests/test_nsec3.py
11
12 diff --git a/dns/rdtypes/ANY/NSEC3.py b/dns/rdtypes/ANY/NSEC3.py
13 index 9a15687..6f21847 100644
14 --- a/dns/rdtypes/ANY/NSEC3.py
15 +++ b/dns/rdtypes/ANY/NSEC3.py
16 @@ -130,7 +130,7 @@ class NSEC3(dns.rdata.Rdata):
17 new_window = nrdtype // 256
18 if new_window != window:
19 if octets != 0:
20 - windows.append((window, ''.join(bitmap[0:octets])))
21 + windows.append((window, bitmap[0:octets]))
22 bitmap = bytearray(b'\0' * 32)
23 window = new_window
24 offset = nrdtype % 256
25 diff --git a/tests/test_nsec3.py b/tests/test_nsec3.py
26 new file mode 100644
27 index 0000000..261c124
28 --- /dev/null
29 +++ b/tests/test_nsec3.py
30 @@ -0,0 +1,39 @@
31 +# Copyright (C) 2006-2017 Nominum, Inc.
32 +#
33 +# Permission to use, copy, modify, and distribute this software and its
34 +# documentation for any purpose with or without fee is hereby granted,
35 +# provided that the above copyright notice and this permission notice
36 +# appear in all copies.
37 +#
38 +# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
39 +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
40 +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
41 +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
42 +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
43 +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
44 +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
45 +
46 +try:
47 + import unittest2 as unittest
48 +except ImportError:
49 + import unittest
50 +
51 +import dns.rdata
52 +import dns.rdataclass
53 +import dns.rdatatype
54 +import dns.rdtypes.ANY.TXT
55 +import dns.ttl
56 +
57 +class NSEC3TestCase(unittest.TestCase):
58 + def test_NSEC3_bitmap(self):
59 + rdata = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.NSEC3,
60 + u"1 0 100 ABCD SCBCQHKU35969L2A68P3AD59LHF30715 A CAA TYPE65534")
61 + bitmap = bytearray(b'\0' * 32)
62 + bitmap[31] = bitmap[31] | 2
63 + self.assertEqual(rdata.windows, [(0, bytearray(b'@')),
64 + (1, bytearray(b'@')), # CAA = 257
65 + (255, bitmap)
66 + ])
67 +
68 +if __name__ == '__main__':
69 + unittest.main()
00 0001-Fix-file-write-location-in-testToFileFilename.patch
1 0002-fix-error-when-parsing-nsec3-bitmap-from-text.patch