diff options
author | Henrik Nord <[email protected]> | 2014-10-23 11:30:40 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-10-23 11:30:40 +0200 |
commit | 9f0477e13bb8819ee252d2b8834c1411f02a9cb8 (patch) | |
tree | 6373cd013fc3ff1220b3845a8e50230d8105c04c /lib/ssh/src/ssh_auth.erl | |
parent | e97f9bc1672cb2d2c07d4133030528b43b26532c (diff) | |
parent | 461757503e8ecaaeb3ea9b84f5c0dfccd3408694 (diff) | |
download | otp-9f0477e13bb8819ee252d2b8834c1411f02a9cb8.tar.gz otp-9f0477e13bb8819ee252d2b8834c1411f02a9cb8.tar.bz2 otp-9f0477e13bb8819ee252d2b8834c1411f02a9cb8.zip |
Merge branch 'maint-17' into maint
Conflicts:
OTP_VERSION
Diffstat (limited to 'lib/ssh/src/ssh_auth.erl')
-rw-r--r-- | lib/ssh/src/ssh_auth.erl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl index b4d406ba8d..45c4d52d7e 100644 --- a/lib/ssh/src/ssh_auth.erl +++ b/lib/ssh/src/ssh_auth.erl @@ -184,9 +184,8 @@ handle_userauth_request(#ssh_msg_service_request{name = handle_userauth_request(#ssh_msg_userauth_request{user = User, service = "ssh-connection", method = "password", - data = Data}, _, + data = <<?FALSE, ?UINT32(Sz), BinPwd:Sz/binary>>}, _, #ssh{opts = Opts} = Ssh) -> - <<_:8, ?UINT32(Sz), BinPwd:Sz/binary>> = Data, Password = unicode:characters_to_list(BinPwd), case check_password(User, Password, Opts) of true -> @@ -201,6 +200,27 @@ handle_userauth_request(#ssh_msg_userauth_request{user = User, handle_userauth_request(#ssh_msg_userauth_request{user = User, service = "ssh-connection", + method = "password", + data = <<?TRUE, + _/binary + %% ?UINT32(Sz1), OldBinPwd:Sz1/binary, + %% ?UINT32(Sz2), NewBinPwd:Sz2/binary + >> + }, _, + Ssh) -> + %% Password change without us having sent SSH_MSG_USERAUTH_PASSWD_CHANGEREQ (because we never do) + %% RFC 4252 says: + %% SSH_MSG_USERAUTH_FAILURE without partial success - The password + %% has not been changed. Either password changing was not supported, + %% or the old password was bad. + + {not_authorized, {User, {error,"Password change not supported"}}, + ssh_transport:ssh_packet(#ssh_msg_userauth_failure{ + authentications = "", + partial_success = false}, Ssh)}; + +handle_userauth_request(#ssh_msg_userauth_request{user = User, + service = "ssh-connection", method = "none"}, _, #ssh{userauth_supported_methods = Methods} = Ssh) -> {not_authorized, {User, undefined}, |