aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/otp_internal.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-04-15 10:29:31 +0200
committerIngela Anderton Andin <[email protected]>2016-04-25 11:25:04 +0200
commit1ad18832cb21fac5a5b513005f1e6a5ffd7d0329 (patch)
tree3080a7756eae9f5ff2c95311dd3fd7b05ee21de2 /lib/stdlib/src/otp_internal.erl
parent79f3e0ef07eff9d22fb1735d77813142da493bfc (diff)
downloadotp-1ad18832cb21fac5a5b513005f1e6a5ffd7d0329.tar.gz
otp-1ad18832cb21fac5a5b513005f1e6a5ffd7d0329.tar.bz2
otp-1ad18832cb21fac5a5b513005f1e6a5ffd7d0329.zip
crypto: Deprecate rand_bytes/1
OpenSSL has deprecated the function RAND_pseudo_bytes used by crypto:rand_bytes/1, so this function is now deprecated in OTP too. rand_bytes/3 also used this function, but was not documented so we can remove it right away. This commit also removes the fallback in generate_key to use rand_bytes/1 if strong_rand_bytes/1 throws low entropy. This is a potential incompatibility but we think it is desirable as crypto should provide cryptographically secure functions.
Diffstat (limited to 'lib/stdlib/src/otp_internal.erl')
-rw-r--r--lib/stdlib/src/otp_internal.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 052dffdbfd..7a59523f06 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -58,7 +58,12 @@ obsolete_1(erlang, now, 0) ->
obsolete_1(calendar, local_time_to_universal_time, 1) ->
{deprecated, {calendar, local_time_to_universal_time_dst, 1}};
-%% *** CRYPTO add in R16B01 ***
+%% *** CRYPTO added in OTP 19 ***
+
+obsolete_1(crypto, rand_bytes, 1) ->
+ {deprecated, {crypto, strong_rand_bytes, 1}};
+
+%% *** CRYPTO added in R16B01 ***
obsolete_1(crypto, md4, 1) ->
{deprecated, {crypto, hash, 2}};