diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-08-28 15:37:55 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-08-28 15:37:55 -0700 |
commit | 797777baad68a1e556d35ef05f346b54452bd7a1 (patch) | |
tree | a1b463d8e458ee5127053399e3be72067263f1a1 | |
parent | 9f1d317b7a9a7c4beb55adaddb50cb19b784e204 (diff) | |
download | paramiko-797777baad68a1e556d35ef05f346b54452bd7a1.tar.gz |
2nd amendment doesn't grant the right to bare excepts
-rw-r--r-- | paramiko/auth_handler.py | 7 | ||||
-rw-r--r-- | sites/www/changelog.rst | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py index 6c515cb6..3d742c06 100644 --- a/paramiko/auth_handler.py +++ b/paramiko/auth_handler.py @@ -459,10 +459,9 @@ class AuthHandler (object): INFO, 'Auth rejected: public key: %s' % str(e)) key = None - except: - self.transport._log( - INFO, - 'Auth rejected: unsupported or mangled public key') + except Exception as e: + msg = 'Auth rejected: unsupported or mangled public key ({0}: {1})' # noqa + self.transport._log(INFO, msg.format(e.__class__.__name__, e)) key = None if key is None: self._disconnect_no_more_auth() diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 3eb88485..83fc8a8f 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,11 @@ Changelog ========= +* :support:`-` Display exception type and message when logging auth-rejection + messages (ones reading ``Auth rejected: unsupported or mangled public key``); + previously this error case had a bare except and did not display exactly why + the key failed. It will now append info such as ``KeyError: + 'some-unknown-type-string'`` or similar. * :feature:`1042` (also partially :issue:`531`) Implement generic (suitable for all key types) client-side certificate authentication. |