aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_auth.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-01-17 15:57:21 +0100
committerHans Nilsson <[email protected]>2014-01-21 16:36:38 +0100
commitf4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0 (patch)
treed69a0f448f831ac73ba08d09dbfdaacbb4d99a0c /lib/ssh/src/ssh_auth.erl
parentf836096cb383c6a3c5c91956ded5bd4e2772bcd2 (diff)
downloadotp-f4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0.tar.gz
otp-f4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0.tar.bz2
otp-f4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0.zip
ssh: Adds unicode
Diffstat (limited to 'lib/ssh/src/ssh_auth.erl')
-rw-r--r--lib/ssh/src/ssh_auth.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl
index 1fa3df847f..409a1db6d5 100644
--- a/lib/ssh/src/ssh_auth.erl
+++ b/lib/ssh/src/ssh_auth.erl
@@ -83,7 +83,7 @@ password_msg([#ssh{opts = Opts, io_cb = IoCb,
method = "password",
data =
<<?BOOLEAN(?FALSE),
- ?STRING(list_to_binary(Password))>>},
+ ?STRING(unicode:characters_to_binary(Password))>>},
Ssh)
end.
@@ -190,8 +190,7 @@ handle_userauth_request(#ssh_msg_userauth_request{user = User,
data = Data}, _,
#ssh{opts = Opts} = Ssh) ->
<<_:8, ?UINT32(Sz), BinPwd:Sz/binary>> = Data,
- Password = binary_to_list(BinPwd),
-
+ Password = unicode:characters_to_list(BinPwd),
case check_password(User, Password, Opts) of
true ->
{authorized, User,
@@ -352,7 +351,7 @@ verify_sig(SessionId, User, Service, Alg, KeyBlob, SigWLen, Opts) ->
build_sig_data(SessionId, User, Service, KeyBlob, Alg) ->
Sig = [?binary(SessionId),
?SSH_MSG_USERAUTH_REQUEST,
- ?string(User),
+ ?string_utf8(User),
?string(Service),
?binary(<<"publickey">>),
?TRUE,