From: Bob Halley Date: Wed, 8 Jul 2020 00:29:35 +0000 (-0700) Subject: Merge pull request #531 from bwelling/tsig2 X-Git-Tag: v2.0.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4ccb0e27ff163a2967530f0356bb4e8c0b5d14a;p=thirdparty%2Fdnspython.git Merge pull request #531 from bwelling/tsig2 Split TSIG sign and validate. --- e4ccb0e27ff163a2967530f0356bb4e8c0b5d14a diff --cc dns/tsig.py index b554e2e7,32738137..8f34fe67 --- a/dns/tsig.py +++ b/dns/tsig.py @@@ -91,12 -90,16 +91,11 @@@ _hashes = default_algorithm = HMAC_SHA256 -BADSIG = 16 -BADKEY = 17 -BADTIME = 18 -BADTRUNC = 22 - - def sign(wire, key, rdata, time=None, request_mac=None, ctx=None, multi=False): - """Return a (tsig_rdata, mac, ctx) tuple containing the HMAC TSIG rdata - for the input parameters, the HMAC MAC calculated by applying the - TSIG signature algorithm, and the TSIG digest context. - @rtype: (string, hmac.HMAC object) + def _digest(wire, key, rdata, time=None, request_mac=None, ctx=None, + multi=None): + """Return a context containing the TSIG rdata for the input parameters + @rtype: hmac.HMAC object @raises ValueError: I{other_data} is too long @raises NotImplementedError: I{algorithm} is not supported """