diff options
| author | Bob Halley <halley@dnspython.org> | 2021-10-10 16:53:26 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2021-10-11 15:01:03 -0700 |
| commit | 51a96a2e2c80aaf81229ce01e3f74a15d67f7ef9 (patch) | |
| tree | 447763f681c750dfe6cfc3250192b2ccde38435d /dns/zone.py | |
| parent | 380846b2d6b550963d3e117f15abf8da26d18505 (diff) | |
| download | dnspython-51a96a2e2c80aaf81229ce01e3f74a15d67f7ef9.tar.gz | |
Fix #698 and #702, problems caused by _cmp() giving the wrong
result in certain comparisons of rdata with relative and absolute
names.
Diffstat (limited to 'dns/zone.py')
| -rw-r--r-- | dns/zone.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dns/zone.py b/dns/zone.py index 9c3204b..d154928 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -733,10 +733,11 @@ class Zone(dns.transaction.TransactionManager): continue rrfixed = struct.pack('!HHI', rdataset.rdtype, rdataset.rdclass, rdataset.ttl) - for rr in sorted(rdataset): - rrdata = rr.to_digestable(self.origin) - rrlen = struct.pack('!H', len(rrdata)) - hasher.update(rrnamebuf + rrfixed + rrlen + rrdata) + rdatas = [rdata.to_digestable(self.origin) + for rdata in rdataset] + for rdata in sorted(rdatas): + rrlen = struct.pack('!H', len(rdata)) + hasher.update(rrnamebuf + rrfixed + rrlen + rdata) return hasher.digest() def compute_digest(self, hash_algorithm, scheme=DigestScheme.SIMPLE): |
