mirror of https://github.com/quasar/Quasar.git
Fixed pre-hashing of password when starting to listen
This commit is contained in:
parent
a9e8eca086
commit
f516d6010f
|
@ -53,6 +53,7 @@ private ushort GetPortSafe()
|
|||
private void btnListen_Click(object sender, EventArgs e)
|
||||
{
|
||||
ushort port = GetPortSafe();
|
||||
string password = txtPassword.Text;
|
||||
|
||||
if (port == 0)
|
||||
{
|
||||
|
@ -61,14 +62,19 @@ private void btnListen_Click(object sender, EventArgs e)
|
|||
return;
|
||||
}
|
||||
|
||||
var newPassword = txtPassword.Text;
|
||||
if (newPassword != Settings.Password)
|
||||
AES.PreHashKey(newPassword);
|
||||
if (password.Length < 3)
|
||||
{
|
||||
MessageBox.Show("Please enter a secure password with more than 3 characters.",
|
||||
"Please enter a secure password", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (btnListen.Text == "Start listening" && !_listenServer.Listening)
|
||||
{
|
||||
try
|
||||
{
|
||||
AES.PreHashKey(password);
|
||||
|
||||
if (chkUseUpnp.Checked)
|
||||
{
|
||||
if (!UPnP.IsDeviceFound)
|
||||
|
@ -117,6 +123,7 @@ private void btnListen_Click(object sender, EventArgs e)
|
|||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
ushort port = GetPortSafe();
|
||||
string password = txtPassword.Text;
|
||||
|
||||
if (port == 0)
|
||||
{
|
||||
|
@ -125,13 +132,19 @@ private void btnSave_Click(object sender, EventArgs e)
|
|||
return;
|
||||
}
|
||||
|
||||
if (password.Length < 3)
|
||||
{
|
||||
MessageBox.Show("Please enter a secure password with more than 3 characters.",
|
||||
"Please enter a secure password", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Settings.ListenPort = port;
|
||||
Settings.AutoListen = chkAutoListen.Checked;
|
||||
Settings.ShowPopup = chkPopup.Checked;
|
||||
var newPassword = txtPassword.Text;
|
||||
if (newPassword != Settings.Password)
|
||||
AES.PreHashKey(newPassword);
|
||||
Settings.Password = newPassword;
|
||||
if (password != Settings.Password)
|
||||
AES.PreHashKey(password);
|
||||
Settings.Password = password;
|
||||
Settings.UseUPnP = chkUseUpnp.Checked;
|
||||
Settings.ShowToolTip = chkShowTooltip.Checked;
|
||||
Settings.EnableNoIPUpdater = chkNoIPIntegration.Checked;
|
||||
|
|
Loading…
Reference in New Issue