aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/src/pubkey_ssh.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-09-12 13:05:29 +0200
committerHans Nilsson <[email protected]>2017-09-12 13:05:29 +0200
commitb6fc9a3964a564ac857838243d8e06ccdb904d5e (patch)
treef2bae5408eb2df9f0d60f0b9cb7a8293efa0d0fe /lib/public_key/src/pubkey_ssh.erl
parent18fb1a9230578456f3d03b4136ed296407bdf53c (diff)
parentef9c973897ea40744600075a7743bf5f2f3fa2f0 (diff)
downloadotp-b6fc9a3964a564ac857838243d8e06ccdb904d5e.tar.gz
otp-b6fc9a3964a564ac857838243d8e06ccdb904d5e.tar.bz2
otp-b6fc9a3964a564ac857838243d8e06ccdb904d5e.zip
Merge branch 'hans/public_key/replace_deprecated_random_funcs/OTP-14608' into maint
Diffstat (limited to 'lib/public_key/src/pubkey_ssh.erl')
-rw-r--r--lib/public_key/src/pubkey_ssh.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/public_key/src/pubkey_ssh.erl b/lib/public_key/src/pubkey_ssh.erl
index 9bda76d670..75c1880655 100644
--- a/lib/public_key/src/pubkey_ssh.erl
+++ b/lib/public_key/src/pubkey_ssh.erl
@@ -79,7 +79,9 @@ dh_gex_group(Min, N, Max, undefined) ->
dh_gex_group(Min, N, Max, Groups) ->
case select_by_keylen(Min-10, N, Max+10, Groups) of
{ok,{Sz,GPs}} ->
- {ok, {Sz,lists:nth(crypto:rand_uniform(1, 1+length(GPs)), GPs)}};
+ Rnd = rand:uniform( length(GPs) ),
+ %% 1 =< Rnd =< length(GPs)
+ {ok, {Sz, lists:nth(Rnd,GPs)}};
Other ->
Other
end.