summaryrefslogtreecommitdiff
path: root/src/mod_sip.erl
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
parentUpdate crypto calls (diff)
Do not crash SIP authentication on SCRAMed passwords
Diffstat (limited to '')
-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 7e7d2f30..4827e0c3 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