aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-11-26 11:46:10 +0100
committerHans Nilsson <[email protected]>2015-11-26 15:09:28 +0100
commit9ec50b9817f7cd852cf3380f665ade9f86323283 (patch)
tree7c7554b2439fe5951d06b492dae0d89b0d28adac /lib/ssh
parent7596e5d97b4154f645eac6152f98c8c28f7ff6f6 (diff)
downloadotp-9ec50b9817f7cd852cf3380f665ade9f86323283.tar.gz
otp-9ec50b9817f7cd852cf3380f665ade9f86323283.tar.bz2
otp-9ec50b9817f7cd852cf3380f665ade9f86323283.zip
ssh: New test cases for SSH_MSG_KEX_DH_GEX_REQUEST_OLD
Diffstat (limited to 'lib/ssh')
-rw-r--r--lib/ssh/test/ssh_protocol_SUITE.erl37
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/ssh/test/ssh_protocol_SUITE.erl b/lib/ssh/test/ssh_protocol_SUITE.erl
index 2415ceba47..dd0adda2dc 100644
--- a/lib/ssh/test/ssh_protocol_SUITE.erl
+++ b/lib/ssh/test/ssh_protocol_SUITE.erl
@@ -60,7 +60,9 @@ groups() ->
gex_client_init_default_noexact,
gex_client_init_default_exact,
gex_client_init_option_groups,
- gex_client_init_option_groups_file
+ gex_client_init_option_groups_file,
+ gex_client_old_request_exact,
+ gex_client_old_request_noexact
]}
].
@@ -79,7 +81,9 @@ init_per_testcase(no_common_alg_server_disconnects, Config) ->
init_per_testcase(TC, Config) when TC == gex_client_init_default_noexact ;
TC == gex_client_init_default_exact ;
TC == gex_client_init_option_groups ;
- TC == gex_client_init_option_groups_file ->
+ TC == gex_client_init_option_groups_file ;
+ TC == gex_client_old_request_exact ;
+ TC == gex_client_old_request_noexact ->
Opts = case TC of
gex_client_init_option_groups ->
[{dh_gex_groups, [{2345, 3, 41}]}];
@@ -101,7 +105,9 @@ end_per_testcase(no_common_alg_server_disconnects, Config) ->
end_per_testcase(TC, Config) when TC == gex_client_init_default_noexact ;
TC == gex_client_init_default_exact ;
TC == gex_client_init_option_groups ;
- TC == gex_client_init_option_groups_file ->
+ TC == gex_client_init_option_groups_file ;
+ TC == gex_client_old_request_exact ;
+ TC == gex_client_old_request_noexact ->
stop_std_daemon(Config);
end_per_testcase(_TestCase, Config) ->
check_std_daemon_works(Config, ?LINE).
@@ -373,6 +379,31 @@ do_gex_client_init(Config, {Min,N,Max}, {_,{G,P}}) ->
]
).
+%%%--------------------------------------------------------------------
+gex_client_old_request_exact(Config) -> do_gex_client_init_old(Config, 2048, ?dh_group14).
+gex_client_old_request_noexact(Config) -> do_gex_client_init_old(Config, 1000, ?dh_group1).
+
+do_gex_client_init_old(Config, N, {_,{G,P}}) ->
+ {ok,_} =
+ ssh_trpt_test_lib:exec(
+ [{set_options, [print_ops, print_seqnums, print_messages]},
+ {connect,
+ server_host(Config),server_port(Config),
+ [{silently_accept_hosts, true},
+ {user_dir, user_dir(Config)},
+ {user_interaction, false},
+ {preferred_algorithms,[{kex,['diffie-hellman-group-exchange-sha1']}]}
+ ]},
+ receive_hello,
+ {send, hello},
+ {send, ssh_msg_kexinit},
+ {match, #ssh_msg_kexinit{_='_'}, receive_msg},
+ {send, #ssh_msg_kex_dh_gex_request_old{n = N}},
+ {match, #ssh_msg_kex_dh_gex_group{p=P, g=G, _='_'}, receive_msg}
+ ]
+ ).
+
+
%%%================================================================
%%%==== Internal functions ========================================
%%%================================================================