]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
RRSIG digestable might as well be right even if it is useless
authorBob Halley <halley@dnspython.org>
Mon, 1 Jun 2020 17:46:23 +0000 (10:46 -0700)
committerBob Halley <halley@dnspython.org>
Mon, 1 Jun 2020 17:46:23 +0000 (10:46 -0700)
dns/rdtypes/ANY/RRSIG.py
tests/test_rdata.py

index 09965ce8d8caaf77cfb6e5cac21cedc2059cfcb1..c7b9e7a1a900ca6d22ea00105727648f7390bf78 100644 (file)
@@ -122,6 +122,14 @@ class RRSIG(dns.rdata.Rdata):
         self.signer.to_wire(file, None, origin)
         file.write(self.signature)
 
+    def to_digestable(self, origin=None):
+        return struct.pack('!HBBIIIH', self.type_covered,
+                           self.algorithm, self.labels,
+                           self.original_ttl, self.expiration,
+                           self.inception, self.key_tag) + \
+                           self.signer.to_digestable(origin) + \
+                           self.signature
+
     @classmethod
     def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None):
         header = struct.unpack('!HBBIIIH', wire[current: current + 18])
index a88b977d14dd1addf6170e7eaf6f1ac61a2efdd7..ed2c3f3b1d0397bc83ca62ade969deba02b878df 100644 (file)
@@ -139,8 +139,6 @@ class RdataTestCase(unittest.TestCase):
         #
         #   types that don't have names: HINFO
         #
-        #   types where the canonical form isn't relevant: RRSIG
-        #
         cases = [
             ('SOA', 'NAME NAME 1 2 3 4 5'),
             ('AFSDB', '0 NAME'),
@@ -156,6 +154,8 @@ class RdataTestCase(unittest.TestCase):
             ('RP', 'NAME NAME'),
             ('RT', '0 NAME'),
             ('SRV', '0 0 0 NAME'),
+            ('RRSIG',
+             'A 1 3 3600 20200701000000 20200601000000 1 NAME Ym9ndXM=')
         ]
         for rdtype, text in cases:
             upper_origin = dns.name.from_text('EXAMPLE')