diff options
Diffstat (limited to 'lib/ssh/test')
20 files changed, 274 insertions, 12 deletions
diff --git a/lib/ssh/test/ssh.cover b/lib/ssh/test/ssh.cover index 69d2a1c4f8..aa0da36c75 100644 --- a/lib/ssh/test/ssh.cover +++ b/lib/ssh/test/ssh.cover @@ -1,3 +1,21 @@ {incl_app,ssh,details}. -{excl_mods, ssh, [ssh_dbg, ssh_info, ssh_server_key_api, ssh_sftpd_file_api]}.
\ No newline at end of file +{excl_mods, ssh, + [ + %% App + ssh_app, + + %% %% Supervisors + %% ssh_acceptor_sup, ssh_channel_sup, ssh_connection_sup, + %% sshc_sup, sshd_sup, ssh_subsystem_sup, ssh_sup, + %% ssh_system_sup, ssh_tcpip_forward_acceptor_sup, + + %% Test and/or info modules: + ssh_dbg, ssh_info, + + %% API modules (behaviours): + ssh_server_key_api, ssh_client_key_api, + ssh_sftpd_file_api, + ssh_channel, ssh_client_channel, ssh_daemon_channel, ssh_server_channel + ]}. + diff --git a/lib/ssh/test/ssh_all.cover b/lib/ssh/test/ssh_all.cover new file mode 100644 index 0000000000..6b2d375589 --- /dev/null +++ b/lib/ssh/test/ssh_all.cover @@ -0,0 +1 @@ +{incl_app,ssh,details}. diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl index 1269ab393e..d1713ae608 100644 --- a/lib/ssh/test/ssh_basic_SUITE.erl +++ b/lib/ssh/test/ssh_basic_SUITE.erl @@ -1218,11 +1218,10 @@ shell_exit_status(Config) when is_list(Config) -> SystemDir = proplists:get_value(data_dir, Config), UserDir = proplists:get_value(priv_dir, Config), - ShellFun = fun (_User) -> spawn(fun() -> ok end) end, {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir}, {user_dir, UserDir}, {user_passwords, [{"vego", "morot"}]}, - {shell, ShellFun}, + {shell, {?MODULE,always_ok,[]}}, {failfun, fun ssh_test_lib:failfun/2}]), ConnectionRef = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, @@ -1236,14 +1235,15 @@ shell_exit_status(Config) when is_list(Config) -> ssh_test_lib:receive_exec_end(ConnectionRef, ChannelId), ssh:stop_daemon(Pid). - +always_ok(_) -> ok. + %%---------------------------------------------------------------------------- setopts_getopts(Config) -> process_flag(trap_exit, true), SystemDir = proplists:get_value(data_dir, Config), UserDir = proplists:get_value(priv_dir, Config), - ShellFun = fun (_User) -> spawn(fun() -> ok end) end, + ShellFun = fun (_User, _Peer) -> spawn(fun() -> ok end) end, {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir}, {user_dir, UserDir}, {user_passwords, [{"vego", "morot"}]}, diff --git a/lib/ssh/test/ssh_dbg_SUITE.erl b/lib/ssh/test/ssh_dbg_SUITE.erl index 8df9c8093a..2320bd4be9 100644 --- a/lib/ssh/test/ssh_dbg_SUITE.erl +++ b/lib/ssh/test/ssh_dbg_SUITE.erl @@ -47,7 +47,9 @@ groups() -> dbg_alg_terminate, dbg_ssh_messages, dbg_connections, - dbg_channels]}, + dbg_channels, + dbg_authentication, + all_dbg]}, {circ_buf, [], [cb_basic, cb_print, cb_macros_print @@ -58,7 +60,7 @@ groups() -> init_per_suite(Config) -> ?CHECK_CRYPTO(begin ssh:start(), - Config + setup_dirs(Config) end). end_per_suite(_Config) -> @@ -193,6 +195,84 @@ dbg_connections(Config) -> stop_and_fail_if_unhandled_dbg_msgs(Ref, [C,D], Pid). %%-------------------------------------------------------------------- +dbg_authentication(Config) -> + Ref = ssh_dbg_start(), + {ok,[authentication]} = ssh_dbg:on([authentication]), + + Parent = self(), + {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, system_dir(Config)}, + {user_dir, user_dir(Config)}, + {user_passwords, [{?USR,?PWD}]}, + {connectfun, fun(_,_,_) -> + Parent ! {daemon_c,Ref,self()} + end}, + {failfun, fun ssh_test_lib:failfun/2}]), + + %% ---- Check password ---- + Cpwd = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, + {user_dir, user_dir(Config)}, + {user,?USR}, + {password,?PWD}, + {auth_methods,"password"}, + {user_interaction, false}]), + Cpwd_d = daemon_connection_ref(Ref, Cpwd), + + ?DBG_RECEIVE("AUTH client: Service ssh-userauth accepted", Ref, Cpwd, Pid), + ?DBG_RECEIVE("AUTH client: Query for accepted methods", Ref, Cpwd, Pid), + ?DBG_RECEIVE("AUTH srvr: Peer queries auth methods", Ref, Cpwd_d, Pid), + ?DBG_RECEIVE("AUTH client: Server supports", Ref, Cpwd, Pid), + ?DBG_RECEIVE("AUTH client: Try auth with", Ref, Cpwd, Pid), + ?DBG_RECEIVE("AUTH srvr: Peer client authorized", Ref, Cpwd_d, Pid), + ?DBG_RECEIVE("AUTH client: Success", Ref, Cpwd, Pid), + ssh:close(Cpwd), + fail_if_unhandled_dbg_msgs(Ref, [Cpwd,Cpwd_d]), + + %% ---- Check keyboard-interactive ---- + Ckbi = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, + {user_dir, user_dir(Config)}, + {user,?USR}, + {password,?PWD}, + {auth_methods,"keyboard-interactive"}, + {user_interaction, false}]), + Ckbi_d = daemon_connection_ref(Ref, Ckbi), + + ?DBG_RECEIVE("AUTH client: Service ssh-userauth accepted", Ref, Ckbi, Pid), + ?DBG_RECEIVE("AUTH client: Query for accepted methods", Ref, Ckbi, Pid), + ?DBG_RECEIVE("AUTH srvr: Peer queries auth methods", Ref, Ckbi_d, Pid), + ?DBG_RECEIVE("AUTH client: Server supports", Ref, Ckbi, Pid), + ?DBG_RECEIVE("AUTH client: Try auth with", Ref, Ckbi, Pid), + ?DBG_RECEIVE("AUTH srvr: Ask peer client for password", Ref, Ckbi_d, Pid), + ?DBG_RECEIVE("AUTH client: Success", Ref, Ckbi, Pid), + ssh:close(Ckbi), + fail_if_unhandled_dbg_msgs(Ref, [Ckbi,Ckbi_d]), + + %% ---- Check publickey ---- + Cpkey = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, + {user_dir, user_dir(Config)}, + {auth_methods,"publickey"}, + {user_interaction, false}]), + Cpkey_d = daemon_connection_ref(Ref, Cpkey), + + ?DBG_RECEIVE("AUTH client: Service ssh-userauth accepted", Ref, Cpkey, Pid), + ?DBG_RECEIVE("AUTH client: Query for accepted methods", Ref, Cpkey, Pid), + ?DBG_RECEIVE("AUTH srvr: Peer queries auth methods", Ref, Cpkey_d, Pid), + ?DBG_RECEIVE("AUTH client: Server supports", Ref, Cpkey, Pid), + ?DBG_RECEIVE("AUTH client: Try auth with", Ref, Cpkey, Pid), + ?DBG_RECEIVE("AUTH srvr: Peer client authorized", Ref, Cpkey_d, Pid), + ?DBG_RECEIVE("AUTH client: Success", Ref, Cpkey, Pid), + ssh:close(Cpkey), + stop_and_fail_if_unhandled_dbg_msgs(Ref, [Cpkey,Cpkey_d], Pid). + + +daemon_connection_ref(Ref,C) -> + D = + receive + {daemon_c,Ref,D0} -> D0 + end, + ct:log("~p:~p~nC = ~p, D=~p",[?MODULE,?LINE, C, D]), + D. + +%%-------------------------------------------------------------------- dbg_ssh_messages(Config) -> SystemDir = proplists:get_value(data_dir, Config), UserDir = proplists:get_value(priv_dir, Config), @@ -353,6 +433,37 @@ dbg_channels(Config) -> stop_and_fail_if_unhandled_dbg_msgs(Ref, [C,D], Pid). %%-------------------------------------------------------------------- +all_dbg(Config) -> + SystemDir = proplists:get_value(data_dir, Config), + UserDir = proplists:get_value(priv_dir, Config), + + Dir0 = filename:join(proplists:get_value(priv_dir,Config), ssh_test_lib:random_chars(10)), + file:make_dir(Dir0), + Dir = w2l(Config, Dir0), + ct:log("~p:~p created the directory~nsDir0 = ~p~nDir = ~p", [?MODULE,?LINE,Dir0,Dir]), + + AllTags = ssh_dbg:start(), + {ok,AllTags} = ssh_dbg:on(AllTags), + + {_, Host, Port} = + ssh_test_lib:daemon([{system_dir, SystemDir}, + {user_dir, UserDir}, + {user_passwords, [{?USR,?PWD}]} + ]), + + {ok, ChPid, _C} = + ssh_sftp:start_channel(Host, Port, + [{user_dir, UserDir}, + {user,?USR}, + {password,?PWD}, + {user_interaction, false}, + {silently_accept_hosts, true} + ]), + + {ok, _Files} = ssh_sftp:list_dir(ChPid, Dir). + + +%%-------------------------------------------------------------------- cb_basic(_Config) -> %% Check that the circular buffer is disabled at start: [] = ssh_dbg:cbuf_list(), @@ -414,6 +525,16 @@ ssh_dbg_start(Ref) -> Ref. %%-------------------------------------------------------------------- +setup_dirs(Config) -> + ct:log("Pub keys setup for: ~p", + [ssh_test_lib:setup_all_user_host_keys(Config)]), + Config. + +system_dir(Config) -> filename:join(proplists:get_value(priv_dir, Config), system). + +user_dir(Config) -> proplists:get_value(priv_dir, Config). + +%%-------------------------------------------------------------------- queued_msgs(Ref, Conns) -> queued_msgs(Ref, Conns, []). @@ -431,11 +552,10 @@ queued_msgs(Ref, Conns, Acc) -> end. %%-------------------------------------------------------------------- -stop_and_fail_if_unhandled_dbg_msgs(Ref, Conns, DaemonPid) -> - stop_and_fail_if_unhandled_dbg_msgs(queued_msgs(Ref,Conns), Ref, Conns, DaemonPid). +fail_if_unhandled_dbg_msgs(Ref, Conns) -> + fail_if_unhandled_dbg_msgs(queued_msgs(Ref,Conns), Ref, Conns). -stop_and_fail_if_unhandled_dbg_msgs(Msgs, _Ref, _Conns, DaemonPid) -> - ssh:stop_daemon(DaemonPid), +fail_if_unhandled_dbg_msgs(Msgs, _Ref, _Conns) -> case Msgs of [] -> ok; @@ -445,6 +565,15 @@ stop_and_fail_if_unhandled_dbg_msgs(Msgs, _Ref, _Conns, DaemonPid) -> end. %%-------------------------------------------------------------------- +stop_and_fail_if_unhandled_dbg_msgs(Ref, Conns, DaemonPid) -> + stop_and_fail_if_unhandled_dbg_msgs(queued_msgs(Ref,Conns), Ref, Conns, DaemonPid). + +stop_and_fail_if_unhandled_dbg_msgs(Msgs, Ref, Conns, DaemonPid) -> + ssh:stop_daemon(DaemonPid), + fail_if_unhandled_dbg_msgs(Msgs, Ref, Conns). + + +%%-------------------------------------------------------------------- dbg_SKIP(Ref, Prefixes) -> dbg_SKIP(Ref, Prefixes, []). @@ -470,3 +599,11 @@ dbg_SKIP(Ref, Prefixes, UnexpectedAcc) -> lists:reverse(UnexpectedAcc) end. +%%%---------------------------------------------------------------- +w2l(P) -> + ssh_test_lib:winpath_to_linuxpath(P). + +w2l(Config, P) -> + W2L = proplists:get_value(w2l, Config, fun(X) -> X end), + W2L(P). + diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_dsa b/lib/ssh/test/ssh_dbg_SUITE_data/id_dsa new file mode 100644 index 0000000000..24628e071b --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_dsa @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBuwIBAAKBgQDIywHurUpOq6kZuMn+XlRzR4hAxF6qwSkuEqkV7iHnLQ0kIwf3 +uAmjFDhuEsQ8653SLxGVvTNp+KFFgDXiLqgM7TPUwDnpbvzEZHPAU+/zPt4sdY2D +txBfJwT2SFlK6HPOxOcxdDuD+/a59sh8hk/YVOU7ZTcBVsVG8Got4UcF5QIVAPGd +CPDQKSTlPiM9OwBB1+9p11k5AoGARLxw4l17mET9cU0uf4Ppe5nsCbODJv44ZrSs +picvypGVLrLcN5KWbm3vjRFCQ5LFunAG3FwLC2Sh0CH6TemoIfRPsRHR7wvpBGdr +c693UlMOis/mcmvNMQAzuQNW9WrxdzsvWR/r5s6NEHWqKUJGXSPi2d+Ijq/mCOmI +hzLzyiACgYEAsTRcHZqZlamr0PM7jKt2edCpcd8rEFGtWuescebc6Ga5JGSv7Ue4 +cdYKpAjT10Mns1WYaU9t6ZR+6ARP7DkzzDmS1elwkRu21T+b81PmeZwaEJxgqr+C +ROQVHgzpqMqEx8ic3c/juxZpRrCAlRCjCWSJLDMobBQvtfyG0qsleNgCFEjA7wTC +sQCY/I35vb6GUJn9tEdP +-----END DSA PRIVATE KEY----- diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_dsa.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_dsa.pub new file mode 100644 index 0000000000..018ef6f537 --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_dsa.pub @@ -0,0 +1 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBAMjLAe6tSk6rqRm4yf5eVHNHiEDEXqrBKS4SqRXuIectDSQjB/e4CaMUOG4SxDzrndIvEZW9M2n4oUWANeIuqAztM9TAOelu/MRkc8BT7/M+3ix1jYO3EF8nBPZIWUroc87E5zF0O4P79rn2yHyGT9hU5TtlNwFWxUbwai3hRwXlAAAAFQDxnQjw0Ckk5T4jPTsAQdfvaddZOQAAAIBEvHDiXXuYRP1xTS5/g+l7mewJs4Mm/jhmtKymJy/KkZUustw3kpZube+NEUJDksW6cAbcXAsLZKHQIfpN6agh9E+xEdHvC+kEZ2tzr3dSUw6Kz+Zya80xADO5A1b1avF3Oy9ZH+vmzo0QdaopQkZdI+LZ34iOr+YI6YiHMvPKIAAAAIEAsTRcHZqZlamr0PM7jKt2edCpcd8rEFGtWuescebc6Ga5JGSv7Ue4cdYKpAjT10Mns1WYaU9t6ZR+6ARP7DkzzDmS1elwkRu21T+b81PmeZwaEJxgqr+CROQVHgzpqMqEx8ic3c/juxZpRrCAlRCjCWSJLDMobBQvtfyG0qsleNg= uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa256 b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa256 new file mode 100644 index 0000000000..4b1eb12eaa --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa256 @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIJfCaBKIIKhjbJl5F8BedqlXOQYDX5ba9Skypllmx/w+oAoGCCqGSM49 +AwEHoUQDQgAE49RbK2xQ/19ji3uDPM7uT4692LbwWF1TiaA9vUuebMGazoW/98br +N9xZu0L1AWwtEjs3kmJDTB7eJEGXnjUAcQ== +-----END EC PRIVATE KEY----- diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa256.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa256.pub new file mode 100644 index 0000000000..a0147e60fa --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa256.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOPUWytsUP9fY4t7gzzO7k+Ovdi28FhdU4mgPb1LnmzBms6Fv/fG6zfcWbtC9QFsLRI7N5JiQ0we3iRBl541AHE= uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa384 b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa384 new file mode 100644 index 0000000000..4e8aa40959 --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa384 @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDCYXb6OSAZyXRfLXOtMo43za197Hdc/T0YKjgQQjwDt6rlRwqTh7v7S +PV2kXwNGdWigBwYFK4EEACKhZANiAARN2khlJUOOIiwsWHEALwDieeZR96qL4pUd +ci7aeGaczdUK5jOA9D9zmBZtSYTfO8Cr7ekVghDlcWAIJ/BXcswgQwSEQ6wyfaTF +8FYfyr4l3u9IirsnyaFzeIgeoNis8Gw= +-----END EC PRIVATE KEY----- diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa384.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa384.pub new file mode 100644 index 0000000000..41e722e545 --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa384.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBE3aSGUlQ44iLCxYcQAvAOJ55lH3qovilR1yLtp4ZpzN1QrmM4D0P3OYFm1JhN87wKvt6RWCEOVxYAgn8FdyzCBDBIRDrDJ9pMXwVh/KviXe70iKuyfJoXN4iB6g2KzwbA== uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa521 b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa521 new file mode 100644 index 0000000000..7196f46e97 --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa521 @@ -0,0 +1,7 @@ +-----BEGIN EC PRIVATE KEY----- +MIHbAgEBBEFMadoz4ckEcClfqXa2tiUuYkJdDfwq+/iFQcpt8ESuEd26IY/vm47Q +9UzbPkO4ou8xkNsQ3WvCRQBBWtn5O2kUU6AHBgUrgQQAI6GBiQOBhgAEAde5BRu5 +01/jS0jRk212xsb2DxPrxNpgp6IMCV8TA4Eps+8bSqHB091nLiBcP422HXYfuCd7 +XDjSs8ihcmhp0hCRASLqZR9EzW9W/SOt876May1Huj5X+WSO6RLe7vPn9vmf7kHf +pip6m7M7qp2qGgQ3q2vRwS2K/O6156ohiOlmuuFs +-----END EC PRIVATE KEY----- diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa521.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa521.pub new file mode 100644 index 0000000000..8f059120bc --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ecdsa521.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHXuQUbudNf40tI0ZNtdsbG9g8T68TaYKeiDAlfEwOBKbPvG0qhwdPdZy4gXD+Nth12H7gne1w40rPIoXJoadIQkQEi6mUfRM1vVv0jrfO+jGstR7o+V/lkjukS3u7z5/b5n+5B36YqepuzO6qdqhoEN6tr0cEtivzuteeqIYjpZrrhbA== uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ed25519 b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed25519 new file mode 100644 index 0000000000..401a3e4a9a --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed25519 @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACDm9P8/gC0IOKmwHLSvkmEtS2Xx0RRqUDqC6wY6UgDVnwAAAJg3+6xpN/us +aQAAAAtzc2gtZWQyNTUxOQAAACDm9P8/gC0IOKmwHLSvkmEtS2Xx0RRqUDqC6wY6UgDVnw +AAAEBzC/Z2WGJhZ3l3tIBnUc6DCbp+lXY2yc2RRpWQTdf8sub0/z+ALQg4qbActK+SYS1L +ZfHRFGpQOoLrBjpSANWfAAAAE3VhYmhuaWxAZWx4YWRsajNxMzIBAg== +-----END OPENSSH PRIVATE KEY----- diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ed25519.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed25519.pub new file mode 100644 index 0000000000..a5c03b19c1 --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOb0/z+ALQg4qbActK+SYS1LZfHRFGpQOoLrBjpSANWf uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ed448 b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed448 new file mode 100644 index 0000000000..8ecfd710dc --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed448 @@ -0,0 +1,10 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAASgAAAAlz +c2gtZWQ0NDgAAAA53OqeePNaG/NJmoMbELhskKrAHNhLZ6AQm1WjbpMoseNl/OFh +1xznExpUPqTLX36fHYsAaWRHABQAAAAA0AAAEREAABERAAAACXNzaC1lZDQ0OAAA +ADnc6p5481ob80magxsQuGyQqsAc2EtnoBCbVaNukyix42X84WHXHOcTGlQ+pMtf +fp8diwBpZEcAFAAAAAByzSPST3FCdOdENDI3uTKQ9RH2Ql+Y5kRZ/yA+iYUIP/32 +BQBVOrwOBc0CGEvbicTM1n4YeVEmfrMo3OqeePNaG/NJmoMbELhskKrAHNhLZ6AQ +m1WjbpMoseNl/OFh1xznExpUPqTLX36fHYsAaWRHABQAAAAAAAECAwQ= +-----END OPENSSH PRIVATE KEY----- + diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_ed448.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed448.pub new file mode 100644 index 0000000000..cec0765a5d --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_ed448.pub @@ -0,0 +1 @@ +ssh-ed448 AAAACXNzaC1lZDQ0OAAAADnc6p5481ob80magxsQuGyQqsAc2EtnoBCbVaNukyix42X84WHXHOcTGlQ+pMtffp8diwBpZEcAFAA= uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_rsa b/lib/ssh/test/ssh_dbg_SUITE_data/id_rsa new file mode 100644 index 0000000000..2202c2ead8 --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_rsa @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAztjiyj2tdfkji0fewWS0kABg0IABgG20NvL1PnHJLr98we7w +W7f3j27EGjW/ApuycsWXXKi0L82q8uDicoHHb3JI2JkT70oi0yG1Dx/zwPN+dkA7 +LBT1J3UK2hJTFPhp855CwY/ss9xpBsd1Fv3zuHifEqNGljeg1PjmQ3pNhxA/M0aZ +cLnfIUdZ5Hr+t+4es3zaWo4tLBKmZu6BkVGQKPGXeMkIAMtJlG24l7qKDRkR5TYA +ZT7P8Vn7hnuFuCNbrJSm686GawBxTQXom23dg9UcWxoHB7UiHFoR6j0bQAX+4R7b +IwculRDcvzrgCu6u06oFILwY7MlsxpX9hGTl1wIDAQABAoIBAFeP6pmQeICrYceR +OhQGLIWVE2bP+VLDnflw6i5v/qlieE6kdm1tOEgorK0nuV9CR81cJdIcvIJL/yTn +3BR7KdDcwUenrY+rg4h7CWmIrigtK4ilciccDBeS7XAZN8B11GxDv6Cu65XMJU2w +W7nK8URTE4vRQI1QqS3e26MPAAi/LVOt3ZPI6zg/GHEwnq0IVSQAOndLBr/IWZk5 +SANrkfwX8WS7/UxZgDptT9dyUQ5Pnj5mieTlIvBwyczdhZ7RDa8HdCSHW3xF83V1 +A0pkn6+TRojumYyr4RrPQj6htE64Hgx9w1Dv/UINjPXl5mGlbxQHMWGzlqD/qpyI +wg7RakECgYEA+9ARZpHfEFz+EEFi8l9J+BtJDo00WaKCOZHh5UJ8W+NreqSd8nSx +5u6wYwMJjRX2Hwv+FBEhxGbo1+ff6p++cYmiSlDtN2XRCDkBWvvGlxu55BDULrhx +f8lqaV3XGmOy2rQusp8hiHmkmPJCSVj3oJqQnbqJ2zahXAx1rTPwHqECgYEA0kln +4h+ZkZ+aldOMGF0d0txTcTqZvsSVKiFTSD9of/fiSDqb6xtLT2+ys6FZoFL9lyK8 +gtqH642CDQ+3WT6Nmn4kMF5HNVpEuCeRDeRhiquWeKaAQDyvZ5ym1+Cn3GhsO7Di +d2LJKV5hOoN77loVY5nwnUVIJ0h+WLf0T7DTCXcCgYEAiNT7X50MdTvS4splFgcp +jqRlAn9AXySrVtUqxwVlxhjCIpapLUK0GSTCvEq+OeghIaXGnujgTHUPOaNKTZgY +SGHdyjxHar7s42b2kZYWx63NSVzLr8eSBTpRlIflhvV+DtGyPmWyNxLCmkmqM2kg +xii3RL5EgtYgwIAUwdVjOYECgYBRPlsMWfkS8f7fc+PkZdVn6gey71kHAxw+MrHi +b90H09Vw4nPq2Zi3EAiSrfvanTWsdpcuVw+8See89B16NViwH5wLs+D/E+kI3QCF +xX6J/NEdu/ZA2zFJbpRnQzyXQyDNzwEv7tKZUQVvfe0boWIyIP99Q48k3jUyQZ/6 +Se6+8QKBgQCXl8H2K3CsZxoujKLb2qoEOPbxJQ2hxoMTS5XuQECReIVsNuptWrur +DF8WJi/B6AqwRX1P3l56RNwqB1yDBqv0QVLpU7vU/FmWqLWTn0r3AvM74qftvfAE +oa31wcYoCqPJoKgCG7TThLhNt2v5hL7sVgZNO0ueAiHhJbFLaf7ceg== +-----END RSA PRIVATE KEY----- diff --git a/lib/ssh/test/ssh_dbg_SUITE_data/id_rsa.pub b/lib/ssh/test/ssh_dbg_SUITE_data/id_rsa.pub new file mode 100644 index 0000000000..b4084d320a --- /dev/null +++ b/lib/ssh/test/ssh_dbg_SUITE_data/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDO2OLKPa11+SOLR97BZLSQAGDQgAGAbbQ28vU+cckuv3zB7vBbt/ePbsQaNb8Cm7JyxZdcqLQvzary4OJygcdvckjYmRPvSiLTIbUPH/PA8352QDssFPUndQraElMU+GnznkLBj+yz3GkGx3UW/fO4eJ8So0aWN6DU+OZDek2HED8zRplwud8hR1nkev637h6zfNpaji0sEqZm7oGRUZAo8Zd4yQgAy0mUbbiXuooNGRHlNgBlPs/xWfuGe4W4I1uslKbrzoZrAHFNBeibbd2D1RxbGgcHtSIcWhHqPRtABf7hHtsjBy6VENy/OuAK7q7TqgUgvBjsyWzGlf2EZOXX uabhnil@elxadlj3q32 diff --git a/lib/ssh/test/ssh_limited.cover b/lib/ssh/test/ssh_limited.cover new file mode 100644 index 0000000000..2b0fcf5bf6 --- /dev/null +++ b/lib/ssh/test/ssh_limited.cover @@ -0,0 +1,22 @@ +%% -*- erlang -*- + +{incl_app,ssh,details}. + +{excl_mods, ssh, + [ + %% App + ssh_app, + + %% Supervisors + ssh_acceptor_sup, ssh_channel_sup, ssh_connection_sup, + sshc_sup, sshd_sup, ssh_subsystem_sup, ssh_sup, + ssh_system_sup, ssh_tcpip_forward_acceptor_sup, + + %% Test and/or info modules: + ssh_dbg, ssh_info, + + %% API modules (behaviours): + ssh_server_key_api, ssh_client_key_api, + ssh_sftpd_file_api, + ssh_channel, ssh_client_channel, ssh_daemon_channel, ssh_server_channel + ]}. diff --git a/lib/ssh/test/ssh_renegotiate_SUITE.erl b/lib/ssh/test/ssh_renegotiate_SUITE.erl index b08a5ab1eb..5eff2fe7ac 100644 --- a/lib/ssh/test/ssh_renegotiate_SUITE.erl +++ b/lib/ssh/test/ssh_renegotiate_SUITE.erl @@ -87,7 +87,10 @@ rekey2() -> [{timetrap,{seconds,120}}]. rekey3() -> [{timetrap,{seconds,120}}]. rekey4() -> [{timetrap,{seconds,120}}]. -rekey0(Config) -> rekey_chk(Config, 0, 0). +rekey0(Config) -> ssh_dbg:start(), ssh_dbg:on(renegotiation), + R = rekey_chk(Config, 0, 0), + ssh_dbg:stop(), + R. rekey1(Config) -> rekey_chk(Config, infinity, 0). rekey2(Config) -> rekey_chk(Config, {infinity,infinity}, 0). rekey3(Config) -> rekey_chk(Config, 0, infinity). |