Do not crash SIP authentication on SCRAMed passwords

This commit is contained in:
Evgeniy Khramtsov 2015-08-02 14:47:06 +03:00
parent dfe3082445
commit f377992232
1 changed files with 6 additions and 2 deletions

View 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