diff options
author | Hans Nilsson <[email protected]> | 2015-08-25 12:57:39 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2015-08-30 11:19:13 +0200 |
commit | badee37e8ad95a9da4d497f12e5e291a66561989 (patch) | |
tree | 54bed42d1324159eae0f10039c7d8bc05163b04d /lib/ssh/src | |
parent | 4b1202b1b683a2e7a4c7a0da41d4112e255801ec (diff) | |
download | otp-badee37e8ad95a9da4d497f12e5e291a66561989.tar.gz otp-badee37e8ad95a9da4d497f12e5e291a66561989.tar.bz2 otp-badee37e8ad95a9da4d497f12e5e291a66561989.zip |
ssh: Reorganize and extend the test suites
Add ssh_trpt_test_lib:instantiate/2, ssh_test_lib:default_algoritms/2 and algo_intersection/2
ssh_to_openssh_SUITE uses only algos that sshd and ssh client supports
raised timeout limit in ssh_basic_SUITE:ssh_connect_arg4_timeout
Break out ssh_renegotiate_SUITE from ssh_basic_SUITE
Move std_daemon/4 to ssh_test_lib.erl
Add ssh_algorithms_SUITE
Add ssh_options_SUITE
Add assymetric testing of algorithms
Add openssh tests to ssh_algorithms_SUITE
Remove algo tests from ssh_sftp_SUITE (now in ssh_algorithms_SUITE)
Removed kex algo tests from in ssh_basic_SUITE because they are now in ssh_algorithm_SUITE.
fixed test case ssh_protocol_SUITE:no_common_alg_server_disconnects/1
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh_transport.erl | 9 | ||||
-rw-r--r-- | lib/ssh/src/ssh_transport.hrl | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl index 235d8918f3..1914b223bc 100644 --- a/lib/ssh/src/ssh_transport.erl +++ b/lib/ssh/src/ssh_transport.erl @@ -801,14 +801,15 @@ alg_final(SSH0) -> {ok,SSH6} = decompress_final(SSH5), SSH6. -select_all(CL, SL) when length(CL) + length(SL) < 50 -> +select_all(CL, SL) when length(CL) + length(SL) < ?MAX_NUM_ALGORITHMS -> A = CL -- SL, %% algortihms only used by client %% algorithms used by client and server (client pref) lists:map(fun(ALG) -> list_to_atom(ALG) end, (CL -- A)); -select_all(_CL, _SL) -> +select_all(CL, SL) -> + Err = lists:concat(["Received too many algorithms (",length(CL),"+",length(SL)," >= ",?MAX_NUM_ALGORITHMS,")."]), throw(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_PROTOCOL_ERROR, - description = "Too many algorithms", - language = "en"}). + description = Err, + language = ""}). select([], []) -> diff --git a/lib/ssh/src/ssh_transport.hrl b/lib/ssh/src/ssh_transport.hrl index e6449e93c5..0bc6b7953b 100644 --- a/lib/ssh/src/ssh_transport.hrl +++ b/lib/ssh/src/ssh_transport.hrl @@ -30,6 +30,13 @@ -define(DEFAULT_CLIENT_VERSION, {2, 0}). -define(DEFAULT_SERVER_VERSION, {2, 0}). +-define(MAX_NUM_ALGORITHMS, 100). + +-define(DEFAULT_DH_GROUP_MIN, 512). +-define(DEFAULT_DH_GROUP_NBITS, 1024). +-define(DEFAULT_DH_GROUP_MAX, 4096). + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% BASIC transport messages @@ -132,10 +139,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% diffie-hellman-group-exchange-sha1 | diffie-hellman-group-exchange-sha256 --define(DEFAULT_DH_GROUP_MIN, 512). --define(DEFAULT_DH_GROUP_NBITS, 1024). --define(DEFAULT_DH_GROUP_MAX, 4096). - -define(SSH_MSG_KEX_DH_GEX_REQUEST_OLD, 30). -define(SSH_MSG_KEX_DH_GEX_REQUEST, 34). -define(SSH_MSG_KEX_DH_GEX_GROUP, 31). |