Browse Source

refine

tags/2.3
clowwindy 10 years ago
parent
commit
237a026914
2 changed files with 8 additions and 3 deletions
  1. +1
    -1
      shadowsocks-csharp/Config.cs
  2. +7
    -2
      shadowsocks-csharp/Encrypt/OpensslEncryptor.cs

+ 1
- 1
shadowsocks-csharp/Config.cs View File

@@ -48,7 +48,7 @@ namespace shadowsocks_csharp
{
server = "127.0.0.1",
server_port = 8388,
local_port = 1081,
local_port = 1080,
password = "barfoo!",
method = "table",
isDefault = true


+ 7
- 2
shadowsocks-csharp/Encrypt/OpensslEncryptor.cs View File

@@ -14,7 +14,13 @@ namespace shadowsocks_csharp.Encrypt
{"aes-256-cfb", new int[]{32, 16}},
{"bf-cfb", new int[]{16, 8}},
{"rc4", new int[]{16, 0}},
};
};
static OpensslEncryptor()
{
OpenSSL.OpenSSL_add_all_ciphers();
}

public OpensslEncryptor(string method, string password)
: base(method, password)
{
@@ -85,7 +91,6 @@ namespace shadowsocks_csharp.Encrypt

private void InitKey(string method, string password)
{
OpenSSL.OpenSSL_add_all_ciphers();
method = method.ToLower();
string k = method + ":" + password;
_cipher = OpenSSL.EVP_get_cipherbyname(System.Text.Encoding.UTF8.GetBytes(method));


Loading…
Cancel
Save