From 774cc46481df73d590b656af93ad2d46aa0e254e Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 7 Nov 2018 13:33:54 +0100 Subject: [PATCH] Use p1_rand:bytes instead of crypto to work in supported Erlang versions (#243) --- ejabberd_auth_http/src/scram2.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ejabberd_auth_http/src/scram2.erl b/ejabberd_auth_http/src/scram2.erl index 1c4ebd9..f344469 100644 --- a/ejabberd_auth_http/src/scram2.erl +++ b/ejabberd_auth_http/src/scram2.erl @@ -132,7 +132,7 @@ password_to_scram(Password) -> password_to_scram(#scram{} = Password, _) -> Password; password_to_scram(Password, IterationCount) -> - Salt = crypto:rand_bytes(?SALT_LENGTH), + Salt = p1_rand:bytes(?SALT_LENGTH), SaltedPassword = salted_password(Password, Salt, IterationCount), StoredKey = stored_key(scram2:client_key(SaltedPassword)), ServerKey = server_key(SaltedPassword),