]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Explicitly use the key's algorithm.
authorBrian Wellington <bwelling@xbill.org>
Wed, 1 Jul 2020 20:23:57 +0000 (13:23 -0700)
committerBrian Wellington <bwelling@xbill.org>
Wed, 1 Jul 2020 20:23:57 +0000 (13:23 -0700)
dns/tsig.py

index c3c849c7dba484ebc0753458f273eae6894e927d..89183cf03ea5432d8897e871ba780bda8bb95784 100644 (file)
@@ -106,7 +106,7 @@ def sign(wire, key, rdata, time=None, request_mac=None, ctx=None, multi=False):
     """
 
     first = not (ctx and multi)
-    (algorithm_name, digestmod) = get_algorithm(rdata.algorithm)
+    (algorithm_name, digestmod) = get_algorithm(key.algorithm)
     if first:
         ctx = hmac.new(key.secret, digestmod=digestmod)
         if request_mac:
@@ -139,7 +139,7 @@ def sign(wire, key, rdata, time=None, request_mac=None, ctx=None, multi=False):
     else:
         ctx = None
     tsig = dns.rdtypes.ANY.TSIG.TSIG(dns.rdataclass.ANY, dns.rdatatype.TSIG,
-                                     rdata.algorithm, time, rdata.fudge, mac,
+                                     key.algorithm, time, rdata.fudge, mac,
                                      rdata.original_id, rdata.error,
                                      rdata.other)