@@ -125,7 +125,7 @@ namespace Shadowsocks.Controller | |||||
{ | { | ||||
throw new ArgumentException("No server configured"); | 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; | this.server = server; | ||||
} | } | ||||
@@ -74,7 +74,7 @@ namespace Shadowsocks.Controller | |||||
} | } | ||||
public void Send(byte[] data, int length) | 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]; | byte[] dataIn = new byte[length - 3 + IVEncryptor.ONETIMEAUTH_BYTES]; | ||||
Array.Copy(data, 3, dataIn, 0, length - 3); | Array.Copy(data, 3, dataIn, 0, length - 3); | ||||
byte[] dataOut = new byte[length - 3 + 16 + IVEncryptor.ONETIMEAUTH_BYTES]; | byte[] dataOut = new byte[length - 3 + 16 + IVEncryptor.ONETIMEAUTH_BYTES]; | ||||
@@ -97,7 +97,7 @@ namespace Shadowsocks.Controller | |||||
byte[] dataOut = new byte[bytesRead]; | byte[] dataOut = new byte[bytesRead]; | ||||
int outlen; | 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); | encryptor.Decrypt(_buffer, bytesRead, dataOut, out outlen); | ||||
byte[] sendBuf = new byte[outlen + 3]; | byte[] sendBuf = new byte[outlen + 3]; | ||||
@@ -17,7 +17,7 @@ namespace Shadowsocks.Model | |||||
public string password; | public string password; | ||||
public string method; | public string method; | ||||
public string remarks; | public string remarks; | ||||
public bool one_time_auth; | |||||
public bool auth; | |||||
public override int GetHashCode() | public override int GetHashCode() | ||||
{ | { | ||||
@@ -53,7 +53,7 @@ namespace Shadowsocks.Model | |||||
this.method = "aes-256-cfb"; | this.method = "aes-256-cfb"; | ||||
this.password = ""; | this.password = ""; | ||||
this.remarks = ""; | this.remarks = ""; | ||||
this.one_time_auth = false; | |||||
this.auth = false; | |||||
} | } | ||||
public Server(string ssURL) : this() | public Server(string ssURL) : this() | ||||
@@ -84,7 +84,7 @@ namespace Shadowsocks.View | |||||
password = PasswordTextBox.Text, | password = PasswordTextBox.Text, | ||||
method = EncryptionSelect.Text, | method = EncryptionSelect.Text, | ||||
remarks = RemarksTextBox.Text, | remarks = RemarksTextBox.Text, | ||||
one_time_auth = OneTimeAuth.Checked | |||||
auth = OneTimeAuth.Checked | |||||
}; | }; | ||||
int localPort = int.Parse(ProxyPortTextBox.Text); | int localPort = int.Parse(ProxyPortTextBox.Text); | ||||
Configuration.CheckServer(server); | Configuration.CheckServer(server); | ||||
@@ -117,7 +117,7 @@ namespace Shadowsocks.View | |||||
ProxyPortTextBox.Text = _modifiedConfiguration.localPort.ToString(); | ProxyPortTextBox.Text = _modifiedConfiguration.localPort.ToString(); | ||||
EncryptionSelect.Text = server.method ?? "aes-256-cfb"; | EncryptionSelect.Text = server.method ?? "aes-256-cfb"; | ||||
RemarksTextBox.Text = server.remarks; | RemarksTextBox.Text = server.remarks; | ||||
OneTimeAuth.Checked = server.one_time_auth; | |||||
OneTimeAuth.Checked = server.auth; | |||||
} | } | ||||
} | } | ||||