mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Fix compilation on Erlang R15B
This commit is contained in:
parent
477d27a3dc
commit
a5d6044448
@ -83,7 +83,7 @@ check_password(User, Server, Password) ->
|
|||||||
#scram{storedkey = StoredKey,
|
#scram{storedkey = StoredKey,
|
||||||
serverkey = ServerKey,
|
serverkey = ServerKey,
|
||||||
salt = Salt,
|
salt = Salt,
|
||||||
iterationcount = binary_to_integer(
|
iterationcount = jlib:binary_to_integer(
|
||||||
IterationCount)},
|
IterationCount)},
|
||||||
is_password_scram_valid(Password, Scram);
|
is_password_scram_valid(Password, Scram);
|
||||||
{selected, [<<"password">>, <<"serverkey">>,
|
{selected, [<<"password">>, <<"serverkey">>,
|
||||||
@ -168,7 +168,7 @@ set_password(User, Server, Password) ->
|
|||||||
ejabberd_odbc:escape(Scram#scram.storedkey),
|
ejabberd_odbc:escape(Scram#scram.storedkey),
|
||||||
ejabberd_odbc:escape(Scram#scram.serverkey),
|
ejabberd_odbc:escape(Scram#scram.serverkey),
|
||||||
ejabberd_odbc:escape(Scram#scram.salt),
|
ejabberd_odbc:escape(Scram#scram.salt),
|
||||||
integer_to_binary(Scram#scram.iterationcount)
|
jlib:integer_to_binary(Scram#scram.iterationcount)
|
||||||
)
|
)
|
||||||
of
|
of
|
||||||
{atomic, ok} -> ok;
|
{atomic, ok} -> ok;
|
||||||
@ -204,7 +204,7 @@ try_register(User, Server, Password) ->
|
|||||||
ejabberd_odbc:escape(Scram#scram.storedkey),
|
ejabberd_odbc:escape(Scram#scram.storedkey),
|
||||||
ejabberd_odbc:escape(Scram#scram.serverkey),
|
ejabberd_odbc:escape(Scram#scram.serverkey),
|
||||||
ejabberd_odbc:escape(Scram#scram.salt),
|
ejabberd_odbc:escape(Scram#scram.salt),
|
||||||
integer_to_binary(Scram#scram.iterationcount)
|
jlib:integer_to_binary(Scram#scram.iterationcount)
|
||||||
) of
|
) of
|
||||||
{updated, 1} -> {atomic, ok};
|
{updated, 1} -> {atomic, ok};
|
||||||
_ -> {atomic, exists}
|
_ -> {atomic, exists}
|
||||||
@ -278,7 +278,7 @@ get_password(User, Server) ->
|
|||||||
{jlib:decode_base64(StoredKey),
|
{jlib:decode_base64(StoredKey),
|
||||||
jlib:decode_base64(ServerKey),
|
jlib:decode_base64(ServerKey),
|
||||||
jlib:decode_base64(Salt),
|
jlib:decode_base64(Salt),
|
||||||
binary_to_integer(IterationCount)};
|
jlib:binary_to_integer(IterationCount)};
|
||||||
_ -> false
|
_ -> false
|
||||||
end;
|
end;
|
||||||
false ->
|
false ->
|
||||||
@ -439,7 +439,7 @@ convert_to_scram(Server) ->
|
|||||||
case ejabberd_odbc:sql_query_t(
|
case ejabberd_odbc:sql_query_t(
|
||||||
[<<"select username, password from users where "
|
[<<"select username, password from users where "
|
||||||
"iterationcount=0 limit ">>,
|
"iterationcount=0 limit ">>,
|
||||||
integer_to_binary(?BATCH_SIZE),
|
jlib:integer_to_binary(?BATCH_SIZE),
|
||||||
<<";">>]) of
|
<<";">>]) of
|
||||||
{selected, [<<"username">>, <<"password">>], []} ->
|
{selected, [<<"username">>, <<"password">>], []} ->
|
||||||
ok;
|
ok;
|
||||||
@ -453,7 +453,7 @@ convert_to_scram(Server) ->
|
|||||||
ejabberd_odbc:escape(Scram#scram.storedkey),
|
ejabberd_odbc:escape(Scram#scram.storedkey),
|
||||||
ejabberd_odbc:escape(Scram#scram.serverkey),
|
ejabberd_odbc:escape(Scram#scram.serverkey),
|
||||||
ejabberd_odbc:escape(Scram#scram.salt),
|
ejabberd_odbc:escape(Scram#scram.salt),
|
||||||
integer_to_binary(Scram#scram.iterationcount)
|
jlib:integer_to_binary(Scram#scram.iterationcount)
|
||||||
)
|
)
|
||||||
end, Rs),
|
end, Rs),
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user