summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2015-11-01 16:35:55 -0800
committerJeff Forcier <jeff@bitprophet.org>2015-11-01 16:35:55 -0800
commitaeff78b28c50844cd15d4774e74e912bcae6f2ca (patch)
tree059b52d4eea6e6b066bba01f38b778996012faed
parente937e37d2559064d3f746e6b969546f44b858e52 (diff)
Log one DEBUG message per key-compute hash algo selection
-rw-r--r--paramiko/transport.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 773a8769..bca4d37e 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -1537,6 +1537,13 @@ class Transport (threading.Thread, ClosingContextManager):
# Fallback to SHA1 for kex engines that fail to specify a hex
# algorithm, or for e.g. transport tests that don't run kexinit.
hash_algo = getattr(self.kex_engine, 'hash_algo', None)
+ hash_select_msg = "kex engine %s specified hash_algo %r" % (self.kex_engine.__class__.__name__, hash_algo)
+ if hash_algo is None:
+ hash_algo = sha1
+ hash_select_msg += ", falling back to sha1"
+ if not hasattr(self, '_logged_hash_selection'):
+ self._log(DEBUG, hash_select_msg)
+ setattr(self, '_logged_hash_selection', True)
out = sofar = hash_algo(m.asbytes()).digest()
while len(out) < nbytes:
m = Message()