]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Add BADTRUNC
authorBob Halley <halley@nominum.com>
Thu, 18 Jun 2009 13:43:59 +0000 (14:43 +0100)
committerBob Halley <halley@nominum.com>
Thu, 18 Jun 2009 13:43:59 +0000 (14:43 +0100)
ChangeLog
dns/tsig.py

index 5a3b41e1b7e6e26b85667e141319ffff30cba66c..d4eaffa2d3bc7fa597d03c59275f7f21bf21b3aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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,
index ce346b854b0e5ac0de6e96aa56f88fa685751094..3f579d10ae9db701f934c8e43200f66a7866185c 100644 (file)
@@ -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