From 0703a8e6d132d4c988d5886233e49d3740c0e6a8 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 1 Jul 2020 13:23:57 -0700 Subject: [PATCH] Explicitly use the key's algorithm. --- dns/tsig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/tsig.py b/dns/tsig.py index c3c849c7..89183cf0 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -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) -- 2.47.3