Fix problem registering users with ejabberd_auth_http

https://www.ejabberd.im/forum/25450/issue-registration-users-over-bosh#new
This commit is contained in:
Badlop 2016-05-11 18:27:14 +02:00
parent 0b5ad7a994
commit d7ce81cd22
1 changed files with 9 additions and 2 deletions

View File

@ -179,8 +179,15 @@ scram_to_tuple(Scram) ->
-spec check_digest(scram(), binary(), fun(), binary()) -> boolean().
check_digest(#scram{storedkey = StoredKey}, Digest, DigestGen, Password) ->
Passwd = base64:decode(StoredKey),
ejabberd_auth:check_digest(Digest, DigestGen, Password, Passwd).
Passwd = jlib:decode_base64(StoredKey),
DigRes = if Digest /= <<"">> ->
Digest == DigestGen(Passwd);
true -> false
end,
if DigRes -> true;
true -> (Passwd == Password) and (Password /= <<"">>)
end.
-ifdef(no_crypto_hmac).
crypto_hmac(sha, Key, Data) ->