From: Brian Wellington Date: Mon, 11 May 2020 17:11:21 +0000 (-0700) Subject: Fix nsec3_hash() when passed a dns.name.Name. X-Git-Tag: v2.0.0rc1~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=667c817a6b2a9c7a9f787609b17d4164971cd597;p=thirdparty%2Fdnspython.git Fix nsec3_hash() when passed a dns.name.Name. The documentation claims that it supports this, but the code was incorrect. --- diff --git a/dns/dnssec.py b/dns/dnssec.py index 0e3143d8..d241cce0 100644 --- a/dns/dnssec.py +++ b/dns/dnssec.py @@ -557,8 +557,8 @@ def nsec3_hash(domain, salt, iterations, algorithm): raise ValueError("Invalid salt length") if not isinstance(domain, dns.name.Name): - domain_encoded = dns.name.from_text(domain) - domain_encoded = domain_encoded.canonicalize().to_wire() + domain = dns.name.from_text(domain) + domain_encoded = domain.canonicalize().to_wire() digest = hashlib.sha1(domain_encoded + salt_encoded).digest() for i in range(iterations):