diff options
author | Hans Nilsson <[email protected]> | 2017-04-12 19:56:12 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-04-12 19:56:12 +0200 |
commit | 24cce98e38f1c8d36abb67bc7aca0668cf64c1ad (patch) | |
tree | ebba2d3e3d905d90058ea2be68e1c3df3f341bf2 /lib/ssh/src | |
parent | 19e9249d960a5b15b4e222efdcb96efbe122853e (diff) | |
download | otp-24cce98e38f1c8d36abb67bc7aca0668cf64c1ad.tar.gz otp-24cce98e38f1c8d36abb67bc7aca0668cf64c1ad.tar.bz2 otp-24cce98e38f1c8d36abb67bc7aca0668cf64c1ad.zip |
ssh: replace deprecated crypto:rand_uniform
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh_transport.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl index 54ea80c727..6b47868d5c 100644 --- a/lib/ssh/src/ssh_transport.erl +++ b/lib/ssh/src/ssh_transport.erl @@ -181,7 +181,7 @@ ssh_vsn() -> end. random_id(Nlo, Nup) -> - [crypto:rand_uniform($a,$z+1) || _<- lists:duplicate(crypto:rand_uniform(Nlo,Nup+1),x) ]. + [$a + rand:uniform($z-$a+1) - 1 || _<- lists:duplicate(Nlo + rand:uniform(Nup-Nlo+1) - 1, x)]. hello_version_msg(Data) -> [Data,"\r\n"]. @@ -1041,7 +1041,7 @@ padding_length(Size, #ssh{encrypt_block_size = BlockSize, end, PadBlockSize = max(BlockSize,4), MaxExtraBlocks = (max(RandomLengthPadding,MinPaddingLen) - MinPaddingLen) div PadBlockSize, - ExtraPaddingLen = try crypto:rand_uniform(0,MaxExtraBlocks)*PadBlockSize + ExtraPaddingLen = try (rand:uniform(MaxExtraBlocks+1) - 1) * PadBlockSize catch _:_ -> 0 end, MinPaddingLen + ExtraPaddingLen. |