diff options
author | Sebastian Deiss <sdeiss@haw-landshut.de> | 2014-07-15 16:50:22 +0200 |
---|---|---|
committer | Sebastian Deiss <sdeiss@haw-landshut.de> | 2014-07-15 16:50:22 +0200 |
commit | 739b40912e5415bf4dbaf868d5f61117d9ecd825 (patch) | |
tree | 2b1eb187319933d84b844d0685c344f5559e9be1 | |
parent | 0be471cfe000a8356838cb2f087a691b857dcc21 (diff) | |
parent | de0d52851a9dc5b3b53fd52298f29c3d79db6910 (diff) |
Merge branch 'akruis-python-gssapi-0.6.1_EOL-fixed' into gssapi-py3-support
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | paramiko/auth_handler.py | 12 | ||||
-rw-r--r-- | paramiko/ssh_gss.py | 12 |
3 files changed, 14 insertions, 12 deletions
@@ -79,7 +79,7 @@ If you want paramiko to do kerberos authentication or key exchange using GSS-API need the following python packages: - pyasn1 0.1.7 or better -- python-gssapi 0.4.0 or better (Unix) +- python-gssapi 0.6.1 or better (Unix) - pywin32 2.1.8 or better (Windows) So you have to install pyasn1 and python-gssapi on Unix or pywin32 on Windows. diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py index cb06da2d..a77ace1b 100644 --- a/paramiko/auth_handler.py +++ b/paramiko/auth_handler.py @@ -515,9 +515,9 @@ class AuthHandler (object): break mic_token = m.get_string() try: - retval = sshgss.ssh_check_mic(mic_token, - self.transport.session_id, - username) + sshgss.ssh_check_mic(mic_token, + self.transport.session_id, + username) except Exception: result = AUTH_FAILED self._send_auth_result(username, method, result) @@ -541,9 +541,9 @@ class AuthHandler (object): result = AUTH_FAILED self._send_auth_result(username, method, result) try: - retval = sshgss.ssh_check_mic(mic_token, - self.transport.session_id, - self.auth_username) + sshgss.ssh_check_mic(mic_token, + self.transport.session_id, + self.auth_username) except Exception: result = AUTH_FAILED self._send_auth_result(username, method, result) diff --git a/paramiko/ssh_gss.py b/paramiko/ssh_gss.py index 58a64a56..03c5dcc0 100644 --- a/paramiko/ssh_gss.py +++ b/paramiko/ssh_gss.py @@ -384,14 +384,16 @@ class _SSH_GSSAPI(_SSH_GSSAuth): self._username, self._service, self._auth_method) - mic_status = self._gss_srv_ctxt.verify_mic(mic_field, - mic_token) + try: + self._gss_srv_ctxt.verify_mic(mic_field, + mic_token) + except gssapi.BadSignature: + raise Exception("GSS-API MIC check failed.") else: # for key exchange with gssapi-keyex # client mode - mic_status = self._gss_ctxt.verify_mic(self._session_id, - mic_token) - return mic_status + self._gss_ctxt.verify_mic(self._session_id, + mic_token) @property def credentials_delegated(self): |