summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2021-04-17 06:57:31 -0700
committerBob Halley <halley@dnspython.org>2021-04-17 06:57:31 -0700
commita5bc3b32311f4cb70b31909b36f4c8bbfa7040c2 (patch)
treeb19f8e5bd09973f3225edd5b7feba700f4bdfb53 /dns
parentfdd998ad2053528cc7763292366cf03c76ede193 (diff)
downloaddnspython-a5bc3b32311f4cb70b31909b36f4c8bbfa7040c2.tar.gz
Fix repr() of GSS-TSIG key [Issue #657]
Diffstat (limited to 'dns')
-rw-r--r--dns/tsig.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/dns/tsig.py b/dns/tsig.py
index 5c773ff..50b2d47 100644
--- a/dns/tsig.py
+++ b/dns/tsig.py
@@ -338,6 +338,9 @@ class Key:
self.algorithm == other.algorithm)
def __repr__(self):
- return f"<DNS key name='{self.name}', " + \
- f"algorithm='{self.algorithm}', " + \
- f"secret='{base64.b64encode(self.secret).decode()}'>"
+ r = f"<DNS key name='{self.name}', " + \
+ f"algorithm='{self.algorithm}'"
+ if self.algorithm != GSS_TSIG:
+ r += f", secret='{base64.b64encode(self.secret).decode()}'"
+ r += ">"
+ return r