summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Wellington <bwelling@xbill.org>2020-05-11 10:11:21 -0700
committerBrian Wellington <bwelling@xbill.org>2020-05-11 10:11:21 -0700
commit667c817a6b2a9c7a9f787609b17d4164971cd597 (patch)
treeedd3e052af6644898a7de62e782d87a56284b84c
parentae964561752b38ebb8685cf1eb91a1f6141a3399 (diff)
downloaddnspython-667c817a6b2a9c7a9f787609b17d4164971cd597.tar.gz
Fix nsec3_hash() when passed a dns.name.Name.
The documentation claims that it supports this, but the code was incorrect.
-rw-r--r--dns/dnssec.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/dnssec.py b/dns/dnssec.py
index 0e3143d..d241cce 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):