diff options
author | Hans Nilsson <[email protected]> | 2015-12-07 10:20:29 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2015-12-07 10:20:29 +0100 |
commit | 1d1677c2a85ebce0ada828d254c7a1122b825e0a (patch) | |
tree | add0d6e5a1e02e1ed2ec71f33f4b94c76c592985 /lib/ssh/src/ssh_auth.erl | |
parent | 572bea9807504670b1eec4aab6b8ac833cd42b26 (diff) | |
parent | 58aff4fafed973059167ea64b6109ce2fec03fe1 (diff) | |
download | otp-1d1677c2a85ebce0ada828d254c7a1122b825e0a.tar.gz otp-1d1677c2a85ebce0ada828d254c7a1122b825e0a.tar.bz2 otp-1d1677c2a85ebce0ada828d254c7a1122b825e0a.zip |
Merge branch 'hans/ssh/pref_public_key_algs/OTP-13158' into maint
* hans/ssh/pref_public_key_algs/OTP-13158:
ssh: tests skips if not supported crypto
ssh: ssh_auth checks support for user pubkey alg
ssh: client pub key opt implemented
ssh: client pub key testcase
ssh: client pub key documentation
Diffstat (limited to 'lib/ssh/src/ssh_auth.erl')
-rw-r--r-- | lib/ssh/src/ssh_auth.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl index 4967a2e4cd..fdbb5c152a 100644 --- a/lib/ssh/src/ssh_auth.erl +++ b/lib/ssh/src/ssh_auth.erl @@ -118,11 +118,16 @@ init_userauth_request_msg(#ssh{opts = Opts} = Ssh) -> service = "ssh-connection", method = "none", data = <<>>}, + Algs0 = proplists:get_value(pref_public_key_algs, Opts, ?SUPPORTED_USER_KEYS), + %% The following line is not strictly correct. The call returns the + %% supported HOST key types while we are interested in USER keys. However, + %% they "happens" to be the same (for now). This could change.... + %% There is no danger as long as the set of user keys is a subset of the set + %% of host keys. + CryptoSupported = ssh_transport:supported_algorithms(public_key), + Algs = [A || A <- Algs0, + lists:member(A, CryptoSupported)], - - Algs = proplists:get_value(public_key, - proplists:get_value(preferred_algorithms, Opts, []), - ssh_transport:default_algorithms(public_key)), Prefs = method_preference(Algs), ssh_transport:ssh_packet(Msg, Ssh#ssh{user = User, userauth_preference = Prefs, |