diff options
author | Hans Nilsson <[email protected]> | 2017-05-18 10:03:34 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-05-22 12:44:02 +0200 |
commit | c99b6f0aa70457453b37533adf6d3872f7009fac (patch) | |
tree | c10d320896b58fdba9be727716a74615846f213b /lib/ssh | |
parent | 594d84311dd22658df695f238ac562fdcba9f060 (diff) | |
download | otp-c99b6f0aa70457453b37533adf6d3872f7009fac.tar.gz otp-c99b6f0aa70457453b37533adf6d3872f7009fac.tar.bz2 otp-c99b6f0aa70457453b37533adf6d3872f7009fac.zip |
ssh: Handle if server-sig-algs and client has empty intersection
In case server-sig-algs names only algorithms unknown to the client, the client will try with the ones it knows
Diffstat (limited to 'lib/ssh')
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index 6a6b9896cb..a77cfe51b5 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -1712,7 +1712,12 @@ ext_info({"server-sig-algs",SigAlgs}, D0 = #data{ssh_params=#ssh{role=client, ], CommonAlgs = [Alg || Alg <- ServerSigAlgs, lists:member(Alg, ClientSigAlgs)], - D0#data{ssh_params = Ssh0#ssh{userauth_pubkeys = CommonAlgs} }; + SelectedAlgs = + case CommonAlgs of + [] -> ClientSigAlgs; % server-sig-algs value is just an advice + _ -> CommonAlgs + end, + D0#data{ssh_params = Ssh0#ssh{userauth_pubkeys = SelectedAlgs} }; ext_info(_, D0) -> %% Not implemented |