diff options
| author | Bob Halley <halley@nominum.com> | 2009-06-18 14:43:59 +0100 |
|---|---|---|
| committer | Bob Halley <halley@nominum.com> | 2009-06-18 14:43:59 +0100 |
| commit | e76a057221024b9d0b27524e4d82900409ff9445 (patch) | |
| tree | c078fffaf3f5122961f2dd5e20468ad74f43edd3 | |
| parent | a7b4f346dabaa410d5a2932869beffda19954d39 (diff) | |
| download | dnspython-e76a057221024b9d0b27524e4d82900409ff9445.tar.gz | |
Add BADTRUNC
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | dns/tsig.py | 7 |
2 files changed, 11 insertions, 0 deletions
@@ -1,5 +1,9 @@ 2009-06-18 Bob Halley <halley@dnspython.org> + * dns/tsig.py: Added support for BADTRUNC result code. + +2009-06-18 Bob Halley <halley@dnspython.org> + * dns/query.py (udp): When checking that addresses are the same, use the binary form of the address in the comparison. This ensures that we don't treat addresses as different if they have diff --git a/dns/tsig.py b/dns/tsig.py index ce346b8..3f579d1 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -46,11 +46,16 @@ class PeerBadTime(PeerError): """Raised if the peer didn't like the time we sent""" pass +class PeerBadTruncation(PeerError): + """Raised if the peer didn't like amount of truncation in the TSIG we sent""" + pass + _alg_name = dns.name.from_text('HMAC-MD5.SIG-ALG.REG.INT.').to_digestable() BADSIG = 16 BADKEY = 17 BADTIME = 18 +BADTRUNC = 22 def hmac_md5(wire, keyname, secret, time, fudge, original_id, error, other_data, request_mac, ctx=None, multi=False, first=True): @@ -138,6 +143,8 @@ def validate(wire, keyname, secret, now, request_mac, tsig_start, tsig_rdata, raise PeerBadKey elif error == BADTIME: raise PeerBadTime + elif error == BADTRUNC: + raise PeerBadTruncation else: raise PeerError, 'unknown TSIG error code %d' % error time_low = time - fudge |
