for password authentication, only utf-8 encode the password if it's in unicode. this should let clients work around servers that expect non-utf-8 passwords (possibly because they predate the RFCs).
This commit is contained in:
parent
ba1fd0d61b
commit
38835bc24c
|
@ -197,6 +197,9 @@ class AuthHandler (object):
|
|||
m.add_string(self.auth_method)
|
||||
if self.auth_method == 'password':
|
||||
m.add_boolean(False)
|
||||
password = self.password
|
||||
if isinstance(password, unicode):
|
||||
password = password.encode('UTF-8')
|
||||
m.add_string(self.password.encode('UTF-8'))
|
||||
elif self.auth_method == 'publickey':
|
||||
m.add_boolean(True)
|
||||
|
|
Loading…
Reference in New Issue