diff options
author | Hans Nilsson <[email protected]> | 2017-05-10 11:42:09 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-05-12 11:53:11 +0200 |
commit | 242dddbc918c87571013e7e0acd29b4abbe12911 (patch) | |
tree | 7a23b483a4f7abb291ed4a187513867de78c9ee7 /lib/ssh/src | |
parent | 6e9f9cbfc1f69735788651369bf6e288e23fbced (diff) | |
download | otp-242dddbc918c87571013e7e0acd29b4abbe12911.tar.gz otp-242dddbc918c87571013e7e0acd29b4abbe12911.tar.bz2 otp-242dddbc918c87571013e7e0acd29b4abbe12911.zip |
ssh: Better error checking for option 'auth_methods'
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh_options.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_options.erl b/lib/ssh/src/ssh_options.erl index f98422c324..78f68dbcb1 100644 --- a/lib/ssh/src/ssh_options.erl +++ b/lib/ssh/src/ssh_options.erl @@ -578,7 +578,16 @@ default(common) -> {auth_methods, def} => #{default => ?SUPPORTED_AUTH_METHODS, - chk => fun check_string/1, + chk => fun(As) -> + try + Sup = string:tokens(?SUPPORTED_AUTH_METHODS, ","), + New = string:tokens(As, ","), + [] == [X || X <- New, + not lists:member(X,Sup)] + catch + _:_ -> false + end + end, class => user_options }, |