diff options
author | Hans Nilsson <[email protected]> | 2017-04-26 16:52:05 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-04-26 19:01:30 +0200 |
commit | 9bcd621df2abf35394cd9f68b42c446d3ab83f11 (patch) | |
tree | 5814ee10161852278b46aa3b0ec03b4f4d0f3bb2 /lib/ssh/src/ssh_connection_handler.erl | |
parent | 98fa13854707fc1f4aecb6d2f7bc167f478bdd6f (diff) | |
download | otp-9bcd621df2abf35394cd9f68b42c446d3ab83f11.tar.gz otp-9bcd621df2abf35394cd9f68b42c446d3ab83f11.tar.bz2 otp-9bcd621df2abf35394cd9f68b42c446d3ab83f11.zip |
ssh: Codenomicon/Defensics fixes
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index 220b05e6b0..74e14a233f 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -1710,6 +1710,7 @@ ext_info({"server-sig-algs",SigAlgs}, D0 = #data{ssh_params=#ssh{role=client}=Ss SupportedAlgs = lists:map(fun erlang:atom_to_list/1, ssh_transport:supported_algorithms(public_key)), Ssh = Ssh0#ssh{userauth_pubkeys = [list_to_atom(SigAlg) || SigAlg <- string:tokens(SigAlgs,","), + %% length of SigAlg is implicitly checked by member: lists:member(SigAlg, SupportedAlgs) ]}, D0#data{ssh_params = Ssh}; @@ -2008,12 +2009,14 @@ handshake(Pid, Ref, Timeout) -> end. update_inet_buffers(Socket) -> - {ok, BufSzs0} = inet:getopts(Socket, [sndbuf,recbuf]), - MinVal = 655360, - case - [{Tag,MinVal} || {Tag,Val} <- BufSzs0, - Val < MinVal] + try + {ok, BufSzs0} = inet:getopts(Socket, [sndbuf,recbuf]), + MinVal = 655360, + [{Tag,MinVal} || {Tag,Val} <- BufSzs0, + Val < MinVal] of [] -> ok; NewOpts -> inet:setopts(Socket, NewOpts) + catch + _:_ -> ok end. |