diff options
-rw-r--r-- | paramiko/auth_handler.py | 12 | ||||
-rw-r--r-- | paramiko/ssh_gss.py | 12 |
2 files changed, 13 insertions, 11 deletions
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): |