aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-10-25 09:59:48 +0200
committerFredrik Gustafsson <[email protected]>2012-11-05 15:43:14 +0100
commit161ddec59071e77bf6fc49db9dd867aa0e0e1268 (patch)
tree68291d9615b3109bc8dee7c1849a5bf3b3a701e6 /lib/ssh/src
parent689b5085d2e9bb1a3fbae81a0e6af600f91a5424 (diff)
downloadotp-161ddec59071e77bf6fc49db9dd867aa0e0e1268.tar.gz
otp-161ddec59071e77bf6fc49db9dd867aa0e0e1268.tar.bz2
otp-161ddec59071e77bf6fc49db9dd867aa0e0e1268.zip
After auth rsa and dsa passwords is set to undefined
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh_connection_manager.erl37
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl
index 01452642b1..16a31459e7 100644
--- a/lib/ssh/src/ssh_connection_manager.erl
+++ b/lib/ssh/src/ssh_connection_manager.erl
@@ -537,12 +537,45 @@ handle_info({'EXIT', _Sup, Reason}, State) ->
{stop, Reason, State}.
handle_password(Opts) ->
+ handle_rsa_password(handle_dsa_password(handle_normal_password(Opts))).
+handle_normal_password(Opts) ->
case proplists:get_value(ssh_opts, Opts, false) of
false ->
Opts;
SshOpts ->
- NewOpts = [{password, undefined}|lists:keydelete(password, 1, SshOpts)],
- {ssh_opts, lists:merge(NewOpts, lists:keydelete(ssh_opts, 1, Opts))}
+ case proplists:get_value(password, SshOpts, false) of
+ false ->
+ Opts;
+ _Password ->
+ NewOpts = [{password, undefined}|lists:keydelete(password, 1, SshOpts)],
+ lists:merge(NewOpts, lists:keydelete(ssh_opts, 1, Opts))
+ end
+ end.
+handle_dsa_password(Opts) ->
+ case proplists:get_value(ssh_opts, Opts, false) of
+ false ->
+ Opts;
+ SshOpts ->
+ case proplists:get_value(dsa_pass_phrase, SshOpts, false) of
+ false ->
+ Opts;
+ _Password ->
+ NewOpts = [{dsa_pass_phase, undefined}|lists:keydelete(password, 1, SshOpts)],
+ lists:merge(NewOpts, lists:keydelete(ssh_opts, 1, Opts))
+ end
+ end.
+handle_rsa_password(Opts) ->
+ case proplists:get_value(ssh_opts, Opts, false) of
+ false ->
+ Opts;
+ SshOpts ->
+ case proplists:get_value(rsa_pass_phrase, SshOpts, false) of
+ false ->
+ Opts;
+ _Password ->
+ NewOpts = [{rsa_pass_phase, undefined}|lists:keydelete(password, 1, SshOpts)],
+ lists:merge(NewOpts, lists:keydelete(ssh_opts, 1, Opts))
+ end
end.
%%--------------------------------------------------------------------
%% Function: terminate(Reason, State) -> void()