aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public_key/src/pubkey_ssh.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-09-11 15:45:10 +0200
committerHans Nilsson <[email protected]>2017-09-12 13:02:26 +0200
commit24053bba1d00ee959d2b388b08e1bd845d9c6bfa (patch)
tree0d83b89ad03e4ea79c0a89b559c5e9d69e68b7e7 /lib/public_key/src/pubkey_ssh.erl
parent18fb1a9230578456f3d03b4136ed296407bdf53c (diff)
downloadotp-24053bba1d00ee959d2b388b08e1bd845d9c6bfa.tar.gz
otp-24053bba1d00ee959d2b388b08e1bd845d9c6bfa.tar.bz2
otp-24053bba1d00ee959d2b388b08e1bd845d9c6bfa.zip
public_key: clearify random set bounderys in comments
Diffstat (limited to 'lib/public_key/src/pubkey_ssh.erl')
-rw-r--r--lib/public_key/src/pubkey_ssh.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/public_key/src/pubkey_ssh.erl b/lib/public_key/src/pubkey_ssh.erl
index 9bda76d670..5055866ab2 100644
--- a/lib/public_key/src/pubkey_ssh.erl
+++ b/lib/public_key/src/pubkey_ssh.erl
@@ -79,7 +79,11 @@ 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 = crypto:rand_uniform(1, 1+length(GPs)),
+ %% 1 =< Rnd < 1+length(GPs)
+ %% <=>
+ %% 1 =< Rnd =< length(GPs)
+ {ok, {Sz, lists:nth(Rnd,GPs)}};
Other ->
Other
end.