default cipher is aes-256-cfb

This commit is contained in:
Y. T. Chung
2014-10-21 14:20:33 +08:00
parent dd27a76444
commit 65157a68ce
3 changed files with 8 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ use std::os;
use shadowsocks::config::Config;
use shadowsocks::relay::TcpRelayLocal;
use shadowsocks::relay::Relay;
use shadowsocks::crypto::cipher::CIPHER_AES_128_CFB;
use shadowsocks::crypto::cipher::CIPHER_AES_256_CFB;
fn main() {
let opts = [
@@ -24,7 +24,7 @@ fn main() {
optopt("k", "password", "password", ""),
optopt("p", "server-port", "server port", ""),
optopt("l", "local-port", "local socks5 proxy port", ""),
optopt("m", "encrypt-method", "entryption method", CIPHER_AES_128_CFB),
optopt("m", "encrypt-method", "entryption method", CIPHER_AES_256_CFB),
];
let matches = getopts(os::args().tail(), opts).unwrap();
@@ -78,7 +78,7 @@ fn main() {
if matches.opt_present("m") {
let mut encrypt_meth = matches.opt_str("m").unwrap();
if encrypt_meth.as_slice() == "" {
encrypt_meth = CIPHER_AES_128_CFB.to_string();
encrypt_meth = CIPHER_AES_256_CFB.to_string();
}
config.method = encrypt_meth;

View File

@@ -11,7 +11,7 @@ use std::os;
use shadowsocks::config::Config;
use shadowsocks::relay::TcpRelayServer;
use shadowsocks::relay::Relay;
use shadowsocks::crypto::cipher::CIPHER_AES_128_CFB;
use shadowsocks::crypto::cipher::CIPHER_AES_256_CFB;
fn main() {
let opts = [
@@ -23,7 +23,7 @@ fn main() {
optopt("k", "password", "password", ""),
optopt("p", "server-port", "server port", ""),
optopt("l", "local-port", "local socks5 proxy port", ""),
optopt("m", "encrypt-method", "entryption method", CIPHER_AES_128_CFB),
optopt("m", "encrypt-method", "entryption method", CIPHER_AES_256_CFB),
];
let matches = getopts(os::args().tail(), opts).unwrap();
@@ -77,7 +77,7 @@ fn main() {
if matches.opt_present("m") {
let mut encrypt_meth = matches.opt_str("m").unwrap();
if encrypt_meth.as_slice() == "" {
encrypt_meth = CIPHER_AES_128_CFB.to_string();
encrypt_meth = CIPHER_AES_256_CFB.to_string();
}
config.method = encrypt_meth;

View File

@@ -10,7 +10,7 @@ use std::fmt::{Show, Formatter, WriteError, mod};
use std::option::Option;
use crypto::cipher::CIPHER_AES_128_CFB;
use crypto::cipher::CIPHER_AES_256_CFB;
#[deriving(Encodable, Clone)]
pub struct Config {
@@ -32,7 +32,7 @@ impl Config {
server_port: 8000,
local_port: 8000,
password: "".to_string(),
method: CIPHER_AES_128_CFB.to_string(),
method: CIPHER_AES_256_CFB.to_string(),
timeout: None,
fast_open: false,
}