diff options
author | Hans Nilsson <[email protected]> | 2018-02-19 13:25:51 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-03-29 11:58:28 +0200 |
commit | 221dc123b58da0952fb77ff13243ecc8b53f1ae4 (patch) | |
tree | ab41a6c785ab623e38e349d1582aaaea0a3059cc /lib/ssh/src/ssh_connection_handler.erl | |
parent | 759ffa6660a8c8d14cc7010d4678160006c9c8e5 (diff) | |
download | otp-221dc123b58da0952fb77ff13243ecc8b53f1ae4.tar.gz otp-221dc123b58da0952fb77ff13243ecc8b53f1ae4.tar.bz2 otp-221dc123b58da0952fb77ff13243ecc8b53f1ae4.zip |
ssh: Add ssh_connection_handler:alg/1 for test purposes
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index f47ab41624..907ecef860 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -68,7 +68,7 @@ -export([init_connection_handler/3, % proc_lib:spawn needs this init_ssh_record/3, % Export of this internal function % intended for low-level protocol test suites - renegotiate/1, renegotiate_data/1 % Export intended for test cases + renegotiate/1, renegotiate_data/1, alg/1 % Export intended for test cases ]). %%==================================================================== @@ -320,6 +320,9 @@ renegotiate(ConnectionHandler) -> renegotiate_data(ConnectionHandler) -> cast(ConnectionHandler, data_size). +%%-------------------------------------------------------------------- +alg(ConnectionHandler) -> + call(ConnectionHandler, get_alg). %%==================================================================== %% Internal process state @@ -1030,6 +1033,10 @@ handle_event(cast, renegotiate, {connected,Role}, D) -> {next_state, {kexinit,Role,renegotiate}, D#data{ssh_params = Ssh, key_exchange_init_msg = KeyInitMsg}}; +handle_event({call,From}, get_alg, _, D) -> + #ssh{algorithms=Algs} = D#data.ssh_params, + {keep_state_and_data, [{reply,From,Algs}]}; + handle_event(cast, renegotiate, _, _) -> %% Already in key-exchange so safe to ignore timer:apply_after(?REKEY_TIMOUT, gen_statem, cast, [self(), renegotiate]), % FIXME: not here in original |