Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2015-08-02 14:47:06 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2015-08-02 14:47:45 +0300
commitf37799223209e428310017829129dbf7f986bb1e (patch)
tree58283f5dd0be3af74fae7a8806cbb049681356f9 /src/mod_sip.erl
parentdfe30824455a77ffad4b7739e5b6dad58eef8d9d (diff)
Do not crash SIP authentication on SCRAMed passwords
Diffstat (limited to 'src/mod_sip.erl')
-rw-r--r--src/mod_sip.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mod_sip.erl b/src/mod_sip.erl
index 7e7d2f307..4827e0c3b 100644
--- a/src/mod_sip.erl
+++ b/src/mod_sip.erl
@@ -263,8 +263,12 @@ check_auth(#sip{method = Method, hdrs = Hdrs, body = Body}, AuthHdr, _SIPSock) -
case ejabberd_auth:get_password_s(LUser, LServer) of
<<"">> ->
false;
- Password ->
- esip:check_auth(Auth, Method, Body, Password)
+ Password when is_binary(Password) ->
+ esip:check_auth(Auth, Method, Body, Password);
+ _ScramedPassword ->
+ ?ERROR_MSG("unable to authenticate ~s@~s against SCRAM'ed "
+ "password", [LUser, LServer]),
+ false
end;
[] ->
false