replace 'one_time_auth' to 'auth'

This commit is contained in:
Gang Zhuo
2015-10-07 23:43:41 -04:00
parent ad8a8c24e6
commit 29d70acfb5
4 changed files with 7 additions and 7 deletions
@@ -125,7 +125,7 @@ namespace Shadowsocks.Controller
{
throw new ArgumentException("No server configured");
}
this.encryptor = EncryptorFactory.GetEncryptor(server.method, server.password, server.one_time_auth, false);
this.encryptor = EncryptorFactory.GetEncryptor(server.method, server.password, server.auth, false);
this.server = server;
}
@@ -74,7 +74,7 @@ namespace Shadowsocks.Controller
}
public void Send(byte[] data, int length)
{
IEncryptor encryptor = EncryptorFactory.GetEncryptor(_server.method, _server.password, _server.one_time_auth, true);
IEncryptor encryptor = EncryptorFactory.GetEncryptor(_server.method, _server.password, _server.auth, true);
byte[] dataIn = new byte[length - 3 + IVEncryptor.ONETIMEAUTH_BYTES];
Array.Copy(data, 3, dataIn, 0, length - 3);
byte[] dataOut = new byte[length - 3 + 16 + IVEncryptor.ONETIMEAUTH_BYTES];
@@ -97,7 +97,7 @@ namespace Shadowsocks.Controller
byte[] dataOut = new byte[bytesRead];
int outlen;
IEncryptor encryptor = EncryptorFactory.GetEncryptor(_server.method, _server.password, _server.one_time_auth, true);
IEncryptor encryptor = EncryptorFactory.GetEncryptor(_server.method, _server.password, _server.auth, true);
encryptor.Decrypt(_buffer, bytesRead, dataOut, out outlen);
byte[] sendBuf = new byte[outlen + 3];
+2 -2
View File
@@ -17,7 +17,7 @@ namespace Shadowsocks.Model
public string password;
public string method;
public string remarks;
public bool one_time_auth;
public bool auth;
public override int GetHashCode()
{
@@ -53,7 +53,7 @@ namespace Shadowsocks.Model
this.method = "aes-256-cfb";
this.password = "";
this.remarks = "";
this.one_time_auth = false;
this.auth = false;
}
public Server(string ssURL) : this()
+2 -2
View File
@@ -84,7 +84,7 @@ namespace Shadowsocks.View
password = PasswordTextBox.Text,
method = EncryptionSelect.Text,
remarks = RemarksTextBox.Text,
one_time_auth = OneTimeAuth.Checked
auth = OneTimeAuth.Checked
};
int localPort = int.Parse(ProxyPortTextBox.Text);
Configuration.CheckServer(server);
@@ -117,7 +117,7 @@ namespace Shadowsocks.View
ProxyPortTextBox.Text = _modifiedConfiguration.localPort.ToString();
EncryptionSelect.Text = server.method ?? "aes-256-cfb";
RemarksTextBox.Text = server.remarks;
OneTimeAuth.Checked = server.one_time_auth;
OneTimeAuth.Checked = server.auth;
}
}