diff options
author | Hans Nilsson <[email protected]> | 2015-10-30 12:25:16 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2015-11-04 12:09:56 +0100 |
commit | 17517fb5ef4e9e7e6913a6eb4527f862ede29271 (patch) | |
tree | 511f7a6f23c5b83c238974bfb8df8321e1600639 /lib/ssh/src/ssh_auth.erl | |
parent | 193ccf4009eb346ca5dd43679b219e395016b03d (diff) | |
download | otp-17517fb5ef4e9e7e6913a6eb4527f862ede29271.tar.gz otp-17517fb5ef4e9e7e6913a6eb4527f862ede29271.tar.bz2 otp-17517fb5ef4e9e7e6913a6eb4527f862ede29271.zip |
ssh: make corrections of keyboard-interactive client
* Newlines should be added after Name and Instructions field according to rfc4256.
* There was an error in the argument list of the last clause of ssh_auth:keyboard_interact_get_responses/9
* Correct client kb-interactive behaviour at auth failure
Diffstat (limited to 'lib/ssh/src/ssh_auth.erl')
-rw-r--r-- | lib/ssh/src/ssh_auth.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl index 4272eb3c52..4967a2e4cd 100644 --- a/lib/ssh/src/ssh_auth.erl +++ b/lib/ssh/src/ssh_auth.erl @@ -364,6 +364,11 @@ method_preference(Algs) -> [{"publickey", ?MODULE, publickey_msg, [A]} | Acc] end, [{"password", ?MODULE, password_msg, []}, + {"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []}, + {"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []}, + {"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []}, + {"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []}, + {"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []}, {"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []} ], Algs). @@ -472,14 +477,14 @@ keyboard_interact_get_responses(false, undefined, undefined, _, _, _, [Prompt|_] ssh_no_io:read_line(Prompt, Opts); %% Throws error as keyboard interaction is not allowed keyboard_interact_get_responses(true, undefined, _,IoCb, Name, Instr, PromptInfos, Opts, _) -> keyboard_interact(IoCb, Name, Instr, PromptInfos, Opts); -keyboard_interact_get_responses(true, Fun, _, Name, Instr, PromptInfos, _, _, NumPrompts) -> +keyboard_interact_get_responses(true, Fun, _Pwd, _IoCb, Name, Instr, PromptInfos, _Opts, NumPrompts) -> keyboard_interact_fun(Fun, Name, Instr, PromptInfos, NumPrompts). keyboard_interact(IoCb, Name, Instr, Prompts, Opts) -> - if Name /= "" -> IoCb:format("~s", [Name]); + if Name /= "" -> IoCb:format("~s~n", [Name]); true -> ok end, - if Instr /= "" -> IoCb:format("~s", [Instr]); + if Instr /= "" -> IoCb:format("~s~n", [Instr]); true -> ok end, lists:map(fun({Prompt, true}) -> IoCb:read_line(Prompt, Opts); |