diff options
author | Hans Nilsson <[email protected]> | 2015-10-21 17:25:42 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2015-11-04 12:10:06 +0100 |
commit | c50a9a6562a14f3a9fbd2071e3b19eed8c9c9b4b (patch) | |
tree | e521160deb7797e1b2180eb31219ede9df877708 /lib/ssh/src/ssh.erl | |
parent | 4f085471fc4e1886bd7549cf135e7038a87e6a8e (diff) | |
download | otp-c50a9a6562a14f3a9fbd2071e3b19eed8c9c9b4b.tar.gz otp-c50a9a6562a14f3a9fbd2071e3b19eed8c9c9b4b.tar.bz2 otp-c50a9a6562a14f3a9fbd2071e3b19eed8c9c9b4b.zip |
ssh, public_key: random selection of diffie-hellman moduli
Also tool (public_key:gen_moduli_hrl) to convert an openssh moduli file to erlang format.
Diffstat (limited to 'lib/ssh/src/ssh.erl')
-rw-r--r-- | lib/ssh/src/ssh.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl index 049018b21c..8d36c847de 100644 --- a/lib/ssh/src/ssh.erl +++ b/lib/ssh/src/ssh.erl @@ -33,7 +33,8 @@ default_algorithms/0, stop_listener/1, stop_listener/2, stop_listener/3, stop_daemon/1, stop_daemon/2, stop_daemon/3, - shell/1, shell/2, shell/3]). + shell/1, shell/2, shell/3 + ]). %%-------------------------------------------------------------------- -spec start() -> ok | {error, term()}. @@ -423,7 +424,11 @@ handle_ssh_option({preferred_algorithms,[_|_]} = Opt) -> handle_ssh_option({dh_gex_groups,L=[{I1,I2,I3}|_]}) when is_integer(I1), I1>0, is_integer(I2), I2>0, is_integer(I3), I3>0 -> - {dh_gex_groups, lists:map(fun({N,G,P}) -> {N,{G,P}} end, L)}; + {dh_gex_groups, public_key:moduli_collect_per_size( + lists:map(fun({N,G,P}) when is_integer(N),N>0, + is_integer(G),G>0, + is_integer(P),P>0 -> {N,{G,P}} end, L) + )}; handle_ssh_option({dh_gex_groups,{file,File=[C|_]}}=Opt) when is_integer(C), C>0 -> %% A string, (file name) case file:consult(File) of |