aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-12-04 09:20:59 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-12-04 09:20:59 +0100
commit72867f8d1e76da1849fe5081c8fb8ade4bbcea59 (patch)
tree5730dbd2f6a95b24692a42767a7616cc05bb672a
parentAdd support for SCRAM-SHA-{256,512}-{PLUS} authentication (diff)
Fix more places that needed changes after scram.erl api modifications
-rw-r--r--src/ejabberd_auth.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl
index 112d677be..aa3284f3d 100644
--- a/src/ejabberd_auth.erl
+++ b/src/ejabberd_auth.erl
@@ -754,8 +754,8 @@ is_password_scram_valid(Password, Scram) ->
_ ->
IterationCount = Scram#scram.iterationcount,
Salt = base64:decode(Scram#scram.salt),
- SaltedPassword = scram:salted_password(Password, Salt, IterationCount),
- StoredKey = scram:stored_key(scram:client_key(SaltedPassword)),
+ SaltedPassword = scram:salted_password(sha, Password, Salt, IterationCount),
+ StoredKey = scram:stored_key(sha, scram:client_key(sha, SaltedPassword)),
base64:decode(Scram#scram.storedkey) == StoredKey
end.
@@ -766,9 +766,9 @@ password_to_scram(#scram{} = Password, _IterationCount) ->
Password;
password_to_scram(Password, IterationCount) ->
Salt = p1_rand:bytes(?SALT_LENGTH),
- SaltedPassword = scram:salted_password(Password, Salt, IterationCount),
- StoredKey = scram:stored_key(scram:client_key(SaltedPassword)),
- ServerKey = scram:server_key(SaltedPassword),
+ SaltedPassword = scram:salted_password(sha, Password, Salt, IterationCount),
+ StoredKey = scram:stored_key(sha, scram:client_key(sha, SaltedPassword)),
+ ServerKey = scram:server_key(sha, SaltedPassword),
#scram{storedkey = base64:encode(StoredKey),
serverkey = base64:encode(ServerKey),
salt = base64:encode(Salt),