From 1ee6eae684c126b486c70a3cadd58fa282f517ad Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 16 Aug 2011 00:26:49 +0200 Subject: Fix and improve support for SCRAM auth method (EJAB-1196) --- src/ejabberd_auth.erl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/ejabberd_auth.erl') diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index d937340f..1eab9af8 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -50,7 +50,7 @@ remove_user/2, remove_user/3, plain_password_required/1, - storage_type/1, + store_type/1, entropy/1 ]). @@ -70,25 +70,26 @@ start() -> end, auth_modules(Host)) end, ?MYHOSTS). +%% This is only executed by ejabberd_c2s for non-SASL auth client plain_password_required(Server) -> lists:any( fun(M) -> M:plain_password_required() end, auth_modules(Server)). -storage_type(Server) -> +store_type(Server) -> lists:foldl( fun(_, external) -> external; (M, scram) -> - case M:storage_type() of + case M:store_type() of external -> external; _Else -> scram end; (M, plain) -> - M:storage_type() + M:store_type() end, plain, auth_modules(Server)). %% @doc Check if the user and password can login in server. @@ -248,8 +249,10 @@ get_password_s(User, Server) -> case get_password(User, Server) of false -> ""; - Password -> - Password + Password when is_list(Password) -> + Password; + _ -> + "" end. %% @doc Get the password of the user and the auth module. -- cgit v1.2.3