mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
ejabberd_stun: Handle hashed passwords gracefully
Don't crash when STUN/TURN authentication is performed against a SCRAM-hashed password.
This commit is contained in:
parent
1db70edcf8
commit
09a87f5a0c
@ -80,7 +80,14 @@ get_password(User, Realm) ->
|
||||
Password when byte_size(Password) > 0 ->
|
||||
Password;
|
||||
<<>> ->
|
||||
ejabberd_auth:get_password_s(User, Realm)
|
||||
case ejabberd_auth:get_password_s(User, Realm) of
|
||||
Password when is_binary(Password) ->
|
||||
Password;
|
||||
_ ->
|
||||
?INFO_MSG("Cannot use hashed password of ~s@~s for "
|
||||
"STUN/TURN authentication", [User, Realm]),
|
||||
<<>>
|
||||
end
|
||||
end.
|
||||
|
||||
%%%===================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user