From 7efe1b6dd3215261777b5f335b4f92dfca7cea42 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Provide a function for password validation. This is called
with user and password as strings, and should return
@@ -313,17 +312,17 @@
Allow an existing file-descriptor to be used
(simply passed on to the transport protocol). Provide a fun() to implement your own logging when a user fails to authenticate. Provide a fun to implement your own logging when a user fails to authenticate. Provide a fun() to implement your own logging when a user authenticates to the server. Provide a fun to implement your own logging when a user authenticates to the server. Provide a fun() to implement your own logging when a user disconnects from the server. Provide a fun to implement your own logging when a user disconnects from the server.
Type definitions that are used more than once in this module and/or abstractions to indicate the intended use of the data - type:
+ type. For more details on public key data types + see theboolean() = true | false
string() = [byte()]
public_key() = #'RSAPublicKey'{}| {integer(), #'Dss-Parms'{}}| term()
-private_key() = #'RSAPublicKey'{}| {integer(), #'Dss-Parms'{}}| term()
+private_key() = #'RSAPrivateKey'{} | #'DSAPrivateKey'{} | term()
public_key_algorithm() = 'ssh-rsa'| 'ssh-dss' | atom()
diff --git a/lib/ssh/doc/src/ssh_server_key_api.xml b/lib/ssh/doc/src/ssh_server_key_api.xml index 51e1fc1f2e..ee537f2f60 100644 --- a/lib/ssh/doc/src/ssh_server_key_api.xml +++ b/lib/ssh/doc/src/ssh_server_key_api.xml @@ -40,7 +40,9 @@Type definitions that are used more than once in this module and/or abstractions to indicate the intended use of the data - type:
+ type. For more details on public key data types + see theboolean() = true | false
string() = [byte()]
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index 753569e442..7ba2179a76 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -429,7 +429,7 @@ userauth(#ssh_msg_userauth_request{service = "ssh-connection", {next_state, connected, next_packet(State#state{auth_user = User, ssh_params = Ssh})}; {not_authorized, {User, Reason}, {Reply, Ssh}} -> - retry_fun(User, Reason, Opts), + retry_fun(User, Address, Reason, Opts), send_msg(Reply, State), {next_state, userauth, next_packet(State#state{ssh_params = Ssh})} end; @@ -1399,23 +1399,31 @@ connected_fun(User, PeerAddr, Method, Opts) -> catch Fun(User, PeerAddr, Method) end. -retry_fun(_, undefined, _) -> +retry_fun(_, _, undefined, _) -> ok; -retry_fun(User, {error, Reason}, Opts) -> +retry_fun(User, PeerAddr, {error, Reason}, Opts) -> case proplists:get_value(failfun, Opts) of undefined -> ok; Fun -> - catch Fun(User, Reason) + do_retry_fun(Fun, User, PeerAddr, Reason) end; -retry_fun(User, Reason, Opts) -> +retry_fun(User, PeerAddr, Reason, Opts) -> case proplists:get_value(infofun, Opts) of undefined -> ok; - Fun -> - catch Fun(User, Reason) + Fun -> + do_retry_fun(Fun, User, PeerAddr, Reason) + end. + +do_retry_fun(Fun, User, PeerAddr, Reason) -> + case erlang:fun_info(Fun, arity) of + 2 -> %% Backwards compatible + catch Fun(User, Reason); + 3 -> + catch Fun(User, PeerAddr, Reason) end. ssh_info([], _State, Acc) -> -- cgit v1.2.3