]> granicus.if.org Git - ejabberd/commitdiff
Do not crash SIP authentication on SCRAMed passwords
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sun, 2 Aug 2015 11:47:06 +0000 (14:47 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sun, 2 Aug 2015 11:47:45 +0000 (14:47 +0300)
src/mod_sip.erl

index 7e7d2f307395157780f18e457a7be7e69f80a979..4827e0c3b1463c797b60ff4a02d5375b70b0c9c1 100644 (file)
@@ -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