From 4d8013b07e7bd46658746cd9d4e5ca4a7df71469 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 21 Nov 2021 02:26:03 -0800 Subject: [PATCH] SettingsDialog: Add 6 character minimum length Security requirements should be held just like every other platform out there, even if they are lax --- data/locale/en-US.ini | 2 ++ src/forms/SettingsDialog.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index eac917ad..e12e3b42 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -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" diff --git a/src/forms/SettingsDialog.cpp b/src/forms/SettingsDialog.cpp index e5d565bc..c32c7f58 100644 --- a/src/forms/SettingsDialog.cpp +++ b/src/forms/SettingsDialog.cpp @@ -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;