empty cli_password and loopback-peers not allowed

Adds a warning to allow-loopback-peers
Does not allow loopback peers and empty passwords.
Quit with an error.
This commit is contained in:
Mészáros Mihály 2017-12-14 13:01:56 +01:00
parent 02fe65681f
commit 5cce82e782

View File

@ -2205,6 +2205,13 @@ int main(int argc, char **argv)
"Be aware that you could not mix the username/password and the shared secret based auth methohds. \n"
"Shared secret overrides username/password based auth method. Check your configuration!\n");
}
if(turn_params.allow_loopback_peers) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_WARNING, "CONFIG WARNING: allow_loopback_peers opens a possible security vulnerability. Do not use in production!!\n");
if(cli_password[0]==0) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "\nCONFIG ERROR: allow_loopback_peers and empty cli password cannot be used together.\n");
exit(-1);
}
}
if(!use_lt_credentials && !anon_credentials) {
if(turn_params.default_users_db.ram_db.users_number) {