summaryrefslogtreecommitdiffstats
path: root/src/erl_make_certs.erl
diff options
context:
space:
mode:
authorMichael Klishin <[email protected]>2021-03-17 19:35:14 +0300
committerLoïc Hoguin <[email protected]>2021-03-18 10:14:50 +0100
commit53477343824e13a009c7140a45fbd4b25c1628a8 (patch)
tree925b5ca7e67e13a207f4b57f9f64d541cf611746 /src/erl_make_certs.erl
parenta56e8a97b83c40400ec633bc20cfc6c028b1c7b4 (diff)
downloadct_helper-53477343824e13a009c7140a45fbd4b25c1628a8.tar.gz
ct_helper-53477343824e13a009c7140a45fbd4b25c1628a8.tar.bz2
ct_helper-53477343824e13a009c7140a45fbd4b25c1628a8.zip
Squash some warnings emitted on Erlang 24
Diffstat (limited to 'src/erl_make_certs.erl')
-rw-r--r--src/erl_make_certs.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/erl_make_certs.erl b/src/erl_make_certs.erl
index 8212ef7..dfa9955 100644
--- a/src/erl_make_certs.erl
+++ b/src/erl_make_certs.erl
@@ -178,7 +178,7 @@ make_tbs(SubjectKey, Opts) ->
subject(proplists:get_value(subject, Opts),false)
end,
- {#'OTPTBSCertificate'{serialNumber = trunc(random:uniform()*100000000)*10000 + 1,
+ {#'OTPTBSCertificate'{serialNumber = trunc(rand:uniform()*100000000)*10000 + 1,
signature = SignAlgo,
issuer = Issuer,
validity = validity(Opts),
@@ -455,7 +455,8 @@ odd_rand(Size) ->
odd_rand(Min, Max).
odd_rand(Min,Max) ->
- Rand = crypto:rand_uniform(Min,Max),
+ Delta = Max - Min,
+ Rand = Min + trunc(rand:uniform() * Delta),
case Rand rem 2 of
0 ->
Rand + 1;