SettingsDialog: Add 6 character minimum length

Security requirements should be held just like every other platform
out there, even if they are lax
This commit is contained in:
tt2468 2021-11-21 02:26:03 -08:00
parent b1de9c8e79
commit 4d8013b07e
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,8 @@ OBSWebSocket.Settings.ShowConnectInfoWarningInfoText="Are you sure that you want
OBSWebSocket.Settings.Save.UserPasswordWarningTitle="Warning: Potential Security Issue"
OBSWebSocket.Settings.Save.UserPasswordWarningMessage="obs-websocket stores the server password as plain text. Using a password generated by obs-websocket is highly recommended."
OBSWebSocket.Settings.Save.UserPasswordWarningInfoText="Are you sure you want to use your own password?"
OBSWebSocket.Settings.Save.PasswordInvalidErrorTitle="Error: Invalid Configuration"
OBSWebSocket.Settings.Save.PasswordInvalidErrorMessage="You must use a password that is 6 or more characters."
OBSWebSocket.SessionTable.Title="Connected WebSocket Sessions"
OBSWebSocket.SessionTable.RemoteAddressColumnTitle="Remote Address"

View File

@ -146,6 +146,15 @@ void SettingsDialog::SaveFormData()
return;
}
if (ui->serverPasswordLineEdit->text().length() < 6) {
QMessageBox msgBox;
msgBox.setWindowTitle(obs_module_text("OBSWebSocket.Settings.Save.PasswordInvalidErrorTitle"));
msgBox.setText(obs_module_text("OBSWebSocket.Settings.Save.PasswordInvalidErrorMessage"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return;
}
// Show a confirmation box to the user if they attempt to provide their own password
if (passwordManuallyEdited && (conf->ServerPassword != ui->serverPasswordLineEdit->text())) {
QMessageBox msgBox;