25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Merge pull request #409 from hamano/scram-stringprep-checking

Scram stringprep checking(correct fix)
This commit is contained in:
Evgeny Khramtsov 2015-01-19 15:23:47 +03:00
commit 104009b3a9

View File

@ -79,7 +79,7 @@ mech_step(#state{step = 2} = State, ClientIn) ->
{Ret, _AuthModule} = (State#state.get_password)(UserName),
case {Ret, jlib:resourceprep(Ret)} of
{false, _} -> {error, <<"not-authorized">>, UserName};
{_, error} -> ?WARNING_MSG("invalid password", []), {error, <<"not-authorized">>, UserName};
{_, error} when is_binary(Ret) -> ?WARNING_MSG("invalid plain password", []), {error, <<"not-authorized">>, UserName};
{Ret, _} ->
{StoredKey, ServerKey, Salt, IterationCount} =
if is_tuple(Ret) -> Ret;