diff --git a/Cargo.toml b/Cargo.toml index ee5c1dd8..66239de6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ cipher-cast5-cfb = [] cipher-des-cfb = [] cipher-idea-cfb = [] cipher-rc2-cfb = [] -cipher-rc4-hmac-md5 = [] cipher-seed-cfb = [] [[bin]] @@ -39,3 +38,6 @@ path = "src/bin/local.rs" name = "ssserver" path = "src/bin/server.rs" + +[dependencies.rust-crypto] +git = "https://github.com/DaGenix/rust-crypto.git" diff --git a/src/crypto/cipher.rs b/src/crypto/cipher.rs index 25a95109..36295d84 100644 --- a/src/crypto/cipher.rs +++ b/src/crypto/cipher.rs @@ -88,8 +88,6 @@ pub const CIPHER_DES_CFB: &'static str = "des-cfb"; pub const CIPHER_IDEA_CFB: &'static str = "idea-cfb"; #[cfg(feature="cipher-rc2-cfb")] pub const CIPHER_RC2_CFB: &'static str = "rc2-cfb"; -#[cfg(feature="cipher-rc4-hmac-md5")] -pub const CIPHER_RC4_HMAC_MD5: &'static str = "rc4-md5"; #[cfg(feature="cipher-seed-cfb")] pub const CIPHER_SEED_CFB: &'static str = "seed-cfb"; @@ -236,8 +234,6 @@ pub fn with_name(method: &str, key: &[u8]) -> Option { CIPHER_IDEA_CFB => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeIdeaCfb, key))), #[cfg(feature="cipher-rc2-cfb")] CIPHER_RC2_CFB => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeRc2Cfb, key))), - #[cfg(feature="cipher-rc4-hmac-md5")] - CIPHER_RC4_HMAC_MD5 => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeRc4HmacMd5, key))), #[cfg(feature="cipher-seed-cfb")] CIPHER_SEED_CFB => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeSeedCfb, key))), diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs index 55a8a18d..1d35352b 100644 --- a/src/crypto/mod.rs +++ b/src/crypto/mod.rs @@ -23,6 +23,8 @@ extern crate libc; extern crate test; +extern crate "rust-crypto" as rust_crypto; pub mod cipher; pub mod openssl; +pub mod rust; diff --git a/src/crypto/openssl.rs b/src/crypto/openssl.rs index 120a001f..c4c29243 100644 --- a/src/crypto/openssl.rs +++ b/src/crypto/openssl.rs @@ -116,8 +116,6 @@ extern { fn EVP_idea_cfb64() -> EVP_CIPHER; #[cfg(feature="cipher-rc2-cfb")] fn EVP_rc2_cfb64() -> EVP_CIPHER; - #[cfg(feature="cipher-rc4-hmac-md5")] - fn EVP_rc4_hmac_md5() -> EVP_CIPHER; #[cfg(feature="cipher-seed-cfb")] fn EVP_seed_cfb128() -> EVP_CIPHER; @@ -253,8 +251,6 @@ impl OpenSSLCrypto { cipher::CipherTypeIdeaCfb => { (EVP_idea_cfb64(), 16, 8) }, #[cfg(feature="cipher-rc2-cfb")] cipher::CipherTypeRc2Cfb => { (EVP_rc2_cfb64(), 16, 8) }, - #[cfg(feature="cipher-rc4-hmac-md5")] - cipher::CipherTypeRc4HmacMd5 => { (EVP_rc4_hmac_md5(), 16, 0) }, #[cfg(feature="cipher-seed-cfb")] cipher::CipherTypeSeedCfb => { (EVP_seed_cfb128(), 16, 16) }, diff --git a/src/relay/socks5.rs b/src/relay/socks5.rs index ef9ca647..c0dcd354 100644 --- a/src/relay/socks5.rs +++ b/src/relay/socks5.rs @@ -19,6 +19,8 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +#![allow(dead_code)] + use std::fmt::{Show, Formatter, FormatError}; use std::io::net::ip::{SocketAddr, Port}; use std::io::net::ip::{Ipv4Addr, Ipv6Addr};