From 667c817a6b2a9c7a9f787609b17d4164971cd597 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 11 May 2020 10:11:21 -0700 Subject: [PATCH] Fix nsec3_hash() when passed a dns.name.Name. The documentation claims that it supports this, but the code was incorrect. --- dns/dnssec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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): -- 2.47.3