diff options
-rw-r--r-- | paramiko/auth_handler.py | 8 | ||||
-rw-r--r-- | paramiko/common.py | 6 | ||||
-rw-r--r-- | paramiko/kex_gss.py | 1 | ||||
-rw-r--r-- | paramiko/ssh_gss.py | 10 |
4 files changed, 21 insertions, 4 deletions
diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py index a048e9b3..9c431c45 100644 --- a/paramiko/auth_handler.py +++ b/paramiko/auth_handler.py @@ -28,7 +28,13 @@ from paramiko.common import cMSG_SERVICE_REQUEST, cMSG_DISCONNECT, \ cMSG_USERAUTH_INFO_REQUEST, WARNING, AUTH_FAILED, cMSG_USERAUTH_PK_OK, \ cMSG_USERAUTH_INFO_RESPONSE, MSG_SERVICE_REQUEST, MSG_SERVICE_ACCEPT, \ MSG_USERAUTH_REQUEST, MSG_USERAUTH_SUCCESS, MSG_USERAUTH_FAILURE, \ - MSG_USERAUTH_BANNER, MSG_USERAUTH_INFO_REQUEST, MSG_USERAUTH_INFO_RESPONSE + MSG_USERAUTH_BANNER, MSG_USERAUTH_INFO_REQUEST, MSG_USERAUTH_INFO_RESPONSE, \ + cMSG_USERAUTH_GSSAPI_RESPONSE, cMSG_USERAUTH_GSSAPI_TOKEN, \ + cMSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, cMSG_USERAUTH_GSSAPI_ERROR, \ + cMSG_USERAUTH_GSSAPI_ERRTOK, cMSG_USERAUTH_GSSAPI_MIC,\ + MSG_USERAUTH_GSSAPI_RESPONSE, MSG_USERAUTH_GSSAPI_TOKEN, \ + MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, MSG_USERAUTH_GSSAPI_ERROR, \ + MSG_USERAUTH_GSSAPI_ERRTOK, MSG_USERAUTH_GSSAPI_MIC from paramiko.message import Message from paramiko.py3compat import bytestring diff --git a/paramiko/common.py b/paramiko/common.py index ed8d9a09..3da43cf2 100644 --- a/paramiko/common.py +++ b/paramiko/common.py @@ -53,6 +53,12 @@ cMSG_USERAUTH_BANNER = byte_chr(MSG_USERAUTH_BANNER) cMSG_USERAUTH_PK_OK = byte_chr(MSG_USERAUTH_PK_OK) cMSG_USERAUTH_INFO_REQUEST = byte_chr(MSG_USERAUTH_INFO_REQUEST) cMSG_USERAUTH_INFO_RESPONSE = byte_chr(MSG_USERAUTH_INFO_RESPONSE) +cMSG_USERAUTH_GSSAPI_RESPONSE = byte_chr(MSG_USERAUTH_GSSAPI_RESPONSE) +cMSG_USERAUTH_GSSAPI_TOKEN = byte_chr(MSG_USERAUTH_GSSAPI_TOKEN) +cMSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE = byte_chr(MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE) +cMSG_USERAUTH_GSSAPI_ERROR = byte_chr(MSG_USERAUTH_GSSAPI_ERROR) +cMSG_USERAUTH_GSSAPI_ERRTOK = byte_chr(MSG_USERAUTH_GSSAPI_ERRTOK) +cMSG_USERAUTH_GSSAPI_MIC = byte_chr(MSG_USERAUTH_GSSAPI_MIC) cMSG_GLOBAL_REQUEST = byte_chr(MSG_GLOBAL_REQUEST) cMSG_REQUEST_SUCCESS = byte_chr(MSG_REQUEST_SUCCESS) cMSG_REQUEST_FAILURE = byte_chr(MSG_REQUEST_FAILURE) diff --git a/paramiko/kex_gss.py b/paramiko/kex_gss.py index 1fb7aea6..1a810b8b 100644 --- a/paramiko/kex_gss.py +++ b/paramiko/kex_gss.py @@ -48,6 +48,7 @@ from Crypto.Hash import SHA from paramiko.common import * from paramiko import util from paramiko.message import Message +from paramiko.py3compat import byte_chr, long, byte_mask, byte_ord from paramiko.ssh_exception import SSHException diff --git a/paramiko/ssh_gss.py b/paramiko/ssh_gss.py index d4b897a7..35d654af 100644 --- a/paramiko/ssh_gss.py +++ b/paramiko/ssh_gss.py @@ -66,6 +66,10 @@ except ImportError: def decode(self): raise NotImplementedError("Module pyasn1 not importable") + class encoder(object): + def encode(self): + raise NotImplementedError("Module pyasn1 not importable") + from paramiko.common import MSG_USERAUTH_REQUEST from paramiko.ssh_exception import SSHException @@ -251,11 +255,11 @@ class _SSH_GSSAuth(object): mic += session_id mic += struct.pack('B', MSG_USERAUTH_REQUEST) mic += self._make_uint32(len(username)) - mic += str.encode(username) + mic += username.encode() mic += self._make_uint32(len(service)) - mic += str.encode(service) + mic += service.encode() mic += self._make_uint32(len(auth_method)) - mic += str.encode(auth_method) + mic += auth_method.encode() return mic |